Ok new quesion.
What is the proper accepted way a Client disconnects from a server?
Does the client send a disconnect request. The Server reply then do say
TcpClient.GetStream.Close () etc
or am I making to much work for myself?
Printable View
Ok new quesion.
What is the proper accepted way a Client disconnects from a server?
Does the client send a disconnect request. The Server reply then do say
TcpClient.GetStream.Close () etc
or am I making to much work for myself?
Depends how sure you need to be that a client has disconnected in a graceful way. I would normally just do TcpClient.Close and that is it but if you need to know when a client disconnects then yeah implement some kind of 'goodbye' routine that alerts the server. Although I dont quite see why the server would need to reply before the client can disconnect because if the client sends this goodbye signal and the server does not respond then there is not a lot more the client can do anyway, it should probably just assume that the server has either disconnected its session or is down, so it may as well carry on with whatever it would do even if the server had acknowledged the goodbye command.
Good stuf thanks.