Does one need to close both NetworkStream and TcpClient, or just TcpClient?

后端 未结 4 1791
暖寄归人
暖寄归人 2021-02-13 00:13

I\'m reading the documentation on TcpClient.Close() and noticed this:

Calling this method will eventually result in the close of the associated Socket and

4条回答
  •  盖世英雄少女心
    2021-02-13 01:16

    Closing the client does not close the stream, it's in the doc of the GetStream method. For the reference, have a look to this discussion : How to properly and completely close/reset a TcpClient connection?

提交回复
热议问题