' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.IO
Imports System.Net.Sockets
Imports System.Runtime.Serialization.Formatters.Binary

Public Class Client
    Public Shared Sub Main(args As String())
        Dim o As T1 = New T1
        o.F1 = 123
        o.F2 = "ABC"
        Dim client As New TcpClient("localhost", 12345)
        Dim binser As BinaryFormatter = New BinaryFormatter()
        binser.Serialize(client.GetStream(), o)
        client.Close()
    End Sub
End Class
