Don’t mean to keep double posting, but I created a simple TcpListener and TcpClient program in Visual Basic (.net)
Server:
Imports System
Imports System.Net
Imports System.Net.Sockets
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim listenserver As New TcpListener(7778)
listenserver.Start()
End Sub
End Class
Client:
Imports System
Imports System.Net
Imports System.Net.Sockets
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim client As New TcpClient()
Dim hostname As String = Dns.GetHostName()
Dim localhost As String = CType(Dns.GetHostByName(hostname).AddressList.GetValue(0), IPAddress).ToString
client.Connect(IPAddress.Parse(localhost), 7778)
If client.Connected Then Label1.Text = "Connected"
End Sub
End Class
I ran ports 7777 and 7778 and I used my 192.x.x.x IP and “127.0.0.1” in all combinations for testing and each time the client connected to the server just fine.