i make sample c# Console application for communication between clients and server using c# socket programming.
communication mean : (in my program the string "hello world" is send by client and server receive and response back to server .)
Clients and Server can communicate with each other when both on same network ,just IP different.
but Clients not sending the string to the server if clients are on other network /Different Network .
e.g think same as now you and me are on different network. i make my pc server and you make your pc client. run my sample {client.cs} exe ,in client.cs there is My server IP include like below:
string serverDNS = "xxx.xx.xx.xx"; // here i put server IP. .
int port = 0;
System.Int32.TryParse("11000", out port);
try
{
IPAddress[] addrs = System.Net.Dns.GetHostAddresses(serverDNS);
foreach (IPAddress addr in addrs)
{
if (addr.AddressFamily == AddressFamily.InterNetwork)
{
endpoint = new IPEndPoint(addr, port);
break;
}
}
}
and i also run on my server pc my sample. in that case i will not able to receive a string "hello worlds" from you (Client pc)>>> this is a problem..
can any body help me please ???
And if in you mind its because of FireWall issue, then tell how can i trace firewall issue ? and also tell me its Clients FireWall issue or Server firewall..and also tell me how to resolve this??
and if due to router then is there any other solution for fix,,without setting router etc ??
Thanks you ..