int readCount; byte[] buffer = new byte[128]; SocketError socketError; TcpClient tcpClient = tcpListener.AcceptTcpClient(); tcpClient.Client.ReceiveTimeout = 500;
If # 1 is replaced by tcpClient.Client.Blocking = false; , tcpClient.Client.Connected has the correct value (true).
I set the Socket.ReceiveTime property to 100 and called Socket.Receive() . Receive() returned integer value is greater than zero. There was no exception. After doing my work with the copied buffer — I did not use any of the socket-related methods — the Socket.Connected property was changed to false. Why?
source share