I am working on a simple TCP / IP application server for greeting in C # and cannot connect my client. Can anyone suggest any additional troubleshooting steps? I'm running out of ideas ...
Here are the relevant sections of the code:
Server:
Console.Out.WriteLine("About to bind address");
IPAddress ipAd = IPAddress.Parse("127.0.0.1");
Console.Out.WriteLine("Choose a port to bind...");
String port = Console.In.ReadLine();
int iPort = Int32.Parse(port);
TcpListener myList = new TcpListener(ipAd, iPort);
myList.Start();
Console.WriteLine("The server is running at: "+myList.LocalEndpoint);
Console.WriteLine("Waiting for a connection.....");
Socket s = myList.AcceptSocket();
Console.WriteLine("Connection accepted from " + s.RemoteEndPoint);
customer:
Console.Out.WriteLine("enter address: ");
string address = Console.In.ReadLine();
Console.Out.WriteLine("enter port: ");
int port = Convert.ToInt32(Console.In.ReadLine());
TcpClient tcpclnt = new TcpClient();
Console.WriteLine("Connecting.....");
Console.Out.WriteLine("Address: " + address + ":" + port);
tcpclnt.Connect(address, port);
I can ping the server from the client machine, however I cannot connect to the server using the connected port. I tried various ports (several in low 8000 and several in about 40,000). I disabled Windows Firewall on both systems. Systems are connected to a router that is not on the Internet. I tried with and without port forwarding to forward incoming requests to this port to the server machine without effect.
, , :
, .
InnerException, , - . ?
, - .
!