I have a windows mobile 6 application that is using TcpListener to start a server and I am unable to get any external connections to be able to connect to the server. The windows mobile device is able to connect to a external server fine, but the reverse seems to be blocked by something. It doesn't matter if the external device is another windows mobile device or PC connected via Ethernet network adapter or an ActiveSync connection to a PC, all incoming connections to the server seem to be blocked.
Here is the code setting up the TcpListener:
IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 1131);
_connListener = new TcpListener(localEndPoint);
_connListener.Start();
TcpClient newConnection = _connListener.AcceptTcpClient();
The application just stays blocked on the accept command, because it never receives a connection from any clients. I have also tried the ipaddress of the network adapter, as well as IPAddress.Any, but the results are the same.
The client application that runs on the PC fails the following lines (where 192.168.33.31 is the ip address of the mobile device when connected using the ethernet network adapter):
TcpClient testClient = new TcpClient();
testClient.Connect("192.168.33.31", 1131);
The exception occurs on the .Connect and states that the "An established connection was aborted by the software in your host machine."
The network connection exists because we can ping both ways. The only thing I can think of is that Windows Mobile 6 has some setting that blocks incoming network connections, but I've yet to find any documentation regarding incoming network connections to windows mobile. Also any google searches typically don't have the windows mobile device set up as the server, and the few related questions that do have a server running on the windows mobile device are unanswered. Thanks in advance.