TcpClient.GetStream().Read() vs. TcpClient.Client.Receive()

前端 未结 3 1338
情书的邮戳
情书的邮戳 2021-01-18 12:20

.NET allows two very similar ways to \"read\" from the network (assuming TCP connection):

1. TcpClient.GetStream().Read() 
2. TcpClient.Client.Receive()
         


        
3条回答
  •  情歌与酒
    2021-01-18 12:58

    To me, a successful Socket.Receive operation with zero bytes received tells you that connection is closed.

提交回复
热议问题