I can run the server on my local machine and connect to it on the same machine, but when i try to connect to it from a different computer over the internet, there is not sign of activity on my server, nor a response from the server on the computer im testing on. Ive tried both XP and vista/turn off firewalls/opened ports/run as admin; nothing is working :(
Here is my code that im used to accept an incoming connection:
int port = 3326;
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
try
{
TcpListener listener = new TcpListener(new IPEndPoint(IPAddress.Any, port));
listener.Start();
Console.WriteLine("Server established\nListening on Port: {0}\n", port);
while (true)
{
socket = listener.AcceptSocket();
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, outime);
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
socket.DontFragment = true;
NewConnection pxy = new NewConnection(socket);
Thread client = new Thread(new ThreadStart(pxy.Start));
client.IsBackground = true;
client.Start();
}
}
Please help!
C#.NET3.5