July 2015
Intermediate to advanced
1300 pages
87h 27m
English
The .NET Framework provides functionalities for data exchange through networks using streams; in particular, it exposes the System.Net.Sockets.NetworkStream class. Reading and writing data via a NetworkStream instance passes through a System.Net.Sockets.TcpClient class’s instance. Code in Listing 18.2 shows how you can both write and read data in such a scenario. See comments in code for explanations.
LISTING 18.2 Networking with NetworkStream
Imports System.Net.SocketsImports System.TextModule Network Sub NetStreamDemo() 'Instantiating TcpClient and NetworkStream Dim customTcpClient As New TcpClient() Dim customNetworkStream As NetworkStream Try 'Attempt ...