Link to home
Start Free TrialLog in
Avatar of __alex
__alex

asked on

Indy: TIdTCPServer.OnDisconnect woes (part II)

It appears that the AThread.Connection.Socket.Binding property is not assigned if a client crashes (AThread: TIdPeerThread is the argument of the TIdTCPServer.OnDisconnect event). How can I get the IP address and the port of the connection that has gone (AThread.Connection.Socket.Binding.PeerIP, AThread.Connection.Socket.Binding.PeerPort)? I need them to free corresponding resources. Actually I loop through an IP-port list and look up the item that's missing in my server instance (<- not very clever?).

Thanks!
Avatar of Ivanov_G
Ivanov_G
Flag of Bulgaria image

I am not sure I understood you, but maybe it is released when the socket crashes... You can rely on some external storage for the connections, because when client crashes, the socket is gone...
Avatar of __alex
__alex

ASKER

Yep, that's what I want to avoid (to keep things simple).
ASKER CERTIFIED SOLUTION
Avatar of Ivanov_G
Ivanov_G
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of __alex

ASKER

Perfect!