Skip to Content
Visual Basic 2015 Unleashed
book

Visual Basic 2015 Unleashed

by Alessandro Del Sole
July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Sams
Content preview from Visual Basic 2015 Unleashed

Networking with Streams

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Visual Basic 2015

Beginning Visual Basic 2015

Bryan Newsome

Publisher Resources

ISBN: 9780134196664Purchase book