' These set up which port to listen and connect on
tcpServer.LocalPort = 1337 ' what to listen on
tcpServer.Listen ' set up the TCP server
tcpClient.RemotePort = 1337 ' what to connect to
Private Sub tcpServer_ConnectionRequest(ByVal requestID As Long)
tcpServer.Accept requestID ' need to accept the connection
End Sub
Private Sub tcpServer_DataArrival(ByVal bytesTotal As Long)
Dim val As String
tcpServer.GetData val
' now do whatever you want with val
End Sub
' To send the data you just call the send function
tcpClient.SendData val