M
Magne Ryholt
Assume a TcpListener has accepted a client connection
(TcpListener.AcceptTcpClient()), then it should write text lines until the
client has closed the connection,
after the client has closed, then the server shall close on it's side.
I am using a StreamWriter on the NetWorkStream on the TcpClient
(StreamWriter sw = new StreamWriter(tcpClient.GetStream())
Is the only way to determine if the client has closed the connection on his
side, to catch an IOException on StreamWriter.Flush() method ?
Should it not be possible to monitor the StreamWriter, NetworkStream,
TcpClient or the underlying Socket to check if the client has closed ?
(TcpListener.AcceptTcpClient()), then it should write text lines until the
client has closed the connection,
after the client has closed, then the server shall close on it's side.
I am using a StreamWriter on the NetWorkStream on the TcpClient
(StreamWriter sw = new StreamWriter(tcpClient.GetStream())

Is the only way to determine if the client has closed the connection on his
side, to catch an IOException on StreamWriter.Flush() method ?
Should it not be possible to monitor the StreamWriter, NetworkStream,
TcpClient or the underlying Socket to check if the client has closed ?