C# Socket.Connected property is changed to false after calling Socket.Receive

后端 未结 2 1527
生来不讨喜
生来不讨喜 2021-01-13 18:52
int readCount;
byte[] buffer = new byte[128];
SocketError socketError;

TcpClient tcpClient = tcpListener.AcceptTcpClient();
tcpClient.Client.ReceiveTimeout = 500; /         


        
2条回答
  •  误落风尘
    2021-01-13 19:11

    This might happen if the remote host is no longer connected to the socket. Is there a timeout on the other side of the connection which might've been exceeded?

提交回复
热议问题