.NET allows two very similar ways to "read" from the network (assuming TCP is connected):
1. TcpClient.GetStream().Read()
2. TcpClient.Client.Receive()
After examining the source code for NetworkStream, it seems like it's an extra shell over the underlying socket, which ultimately calls Socket methods.
Question: What is the use of using the “indirect” variation of NetworkStream (# 1) instead of using the direct shell provided by the Socket implementation?
Thank you Boris.
Borka source
share