I'm following the MSDN tutorial here which details how to make a basic client-server TCP chat program.
I have all the code in place, and it is compiling, however I'm hitting an issue in the socketClient class, when trying to create the new TcpListener object.
The tutorial says to use the line:
mobjClient = New TcpClient("localhost", 5000)
However, on running this, I get the error:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dll Additional information: A non-recoverable error occurred during a database lookup
Playing with the hostname part of the constructor, I get an identical message for the following as parameters. The function call returns the name of the machine correctly.
(System.Net.Dns.GetHostName(), 5000)
I also tried using the IP of the machine, both as 127.0.0.1 and it's actual IP. Using an IP gives a slightly different error of
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dll Additional information: An invalid argument was supplied
I also found this link which is someone else using the same tutorial, which supplies complete code.