Hello All,
I have a client/server pair of programs in which the client makes a connection to the server, and then the connection can potentially lie dormant for a time until commands are sent back and forth. During this dormant state, I want to be able to fire a TCP-client-disconnected event if the user of the client program decides they wish to log off of the TCP server. I use:
to try and accomplish this, but it seems the TCPServer.OnDisconnect method is never triggered - UNLESS the server is attempting to do:
while the client disconnects.
Do I have to be reading from the connection in order to fire this event? Being forced to do this messes up the flow and functionality of my program as currently written.
-Tony
I have a client/server pair of programs in which the client makes a connection to the server, and then the connection can potentially lie dormant for a time until commands are sent back and forth. During this dormant state, I want to be able to fire a TCP-client-disconnected event if the user of the client program decides they wish to log off of the TCP server. I use:
Code:
TCPClient.Disconnect;
to try and accomplish this, but it seems the TCPServer.OnDisconnect method is never triggered - UNLESS the server is attempting to do:
Code:
AThread.Connection.ReadLn();
while the client disconnects.
Do I have to be reading from the connection in order to fire this event? Being forced to do this messes up the flow and functionality of my program as currently written.
-Tony