I have used this link. and when i try to connect two different machines 192.168.1.4 and 192.168.1.9. I changed this part in the server code
TcpListener myList = new TcpListener(IPAddress.Any, 27505);
instead of
IPAddress ipAd = IPAddress.Parse("192.168.1.9");
TcpListener myList = new TcpListener(ipAd, 27505);
I get this error in the client
Unhandled Exception: System.Net.Sockets.SocketException: A connection attempt fa
iled because the connected party did not properly respond after a period of time
, or established connection failed because connected host has failed to respond
192.168.1.4:8001
at System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port)
at Client.Client.send() in C:\Users\John\Documents\Visual Studio 2010\Project
s\Server Client\Client\Client.cs:line 111
at Client.Client.Main(String[] args) in C:\Users\John\Documents\Visual Studio
2010\Projects\Server Client\Client\Client.cs:line 147
I have tried to run them both on the same machine and it worked. How to fix it ?