For this exercise a program is open a socket to localhost on port 256 and send the message "hello socket world" before closing the socket.

Catching any exceptions or errors is not required.




Imports System
Imports System.IO
Imports System.Net.Sockets
 
Public Class Program 
    Public Shared Sub Main(ByVal args As String[])
        Dim tcp As New TcpClient("localhost", 256)
        Dim writer As New StreamWriter(tcp.GetStream())
 
        writer.Write("hello socket world")
        writer.Flush()
 
        tcp.Close()
    End Sub
End Class