LcSalazar
LcSalazar

Reputation: 16821

Windows firewall blocking tcp port even with an exception rule

I'm developing an Android app that communicates with a desktop .NET application through tcp sockets. But I'm facing an issue with computer's firewall. The applications act both as servers and clients, and they listen to port 50655.

The communication is working, I can successfully send a tcp message from Android to PC, and from PC to Android, but only as long as the Firewall is disabled.

If I turn on the firewall, the PC can still send messages to Android, but the Android application throws a timeout exception on the creation of the socket:

Socket s = new Socket("192.168.1.116", 50655); // This times out when Firewall is active

And yes, I have added a firewall exception for this port:

enter image description here

I have worked with TCP communication before, but I just can't figure this one out... Have anyone else experienced something like it? Am I missing something here?

Upvotes: 1

Views: 3140

Answers (2)

ComradeJoecool
ComradeJoecool

Reputation: 814

Please check the following in the window you have open in the screenshot

  1. On General tab Action should be set to "Allow the connection" and "Enabled" should be checked
  2. On Programs and Services tab try "All programs that meet the specified conditions"
  3. On Scope tab Local IP and Remote IP should be "Any IP address"
  4. On Advanced tab check all profiles (Private, Public, Domain)

If none of those work, you may have a different Block rule that is taking priority over the Allow. If there are two rules on the same port a Block takes priority. Try looking for that.

Once you have all of those settings it should work. Once it is working you can reduce the openings to just what you need to increase security. So once it is working I recommend just making it the specific program, specific IP (if possible), and specific profile of your network.

Upvotes: 1

Alexandre
Alexandre

Reputation: 58

Have you added the program to firewall exception?

Upvotes: 0

Related Questions