using winsock with public IP

So i created my winsock tcp server and client running at the port 270
Everything works fine using the local address 127.0.0.1 but when i try (using 2 different computers connected to 2 different wifi) using public ip the client doesn't connect to the server.
I also port forwarded every incoming connection on the port 270 to the pc running the client but still doesn't work

How can i use winsock with public IP's?
Are you using the computer's local ip or are you forwarding to 127.0.0.1? Make sure you didn't type the localhost address (127.0.0.1) which is a loopback address instead of the ip address of your computer (which you can find using ipconfig from your command line in Windows) into your router's port forwarding window. Also be sure you used the same port number incoming and forwarded (you can take external traffic and route it through a different port)

Does it work with two different computers on the same wifi network using the local ip?

If all of the above is correct I would guess you have a firewall rule blocking outside traffic- the loopback ip isn't the best indication of a working server. Temporarily try disabling your firewall. (turn it back on if that is the problem then resolve that particular issue, unless you're into that sort of thing)

If all else fails you can test with the DMZ on your router pointed to your local computer (but don't leave the DMZ on, unless you're into that sort of thing) which will route all external traffic to your local computer.

Okay, so it worked pointing the DMZ to my pc
Why i do need to disable DMZ if is not needed?
Pointing a DMZ to a PC opens that computer to all incoming packets from the internet. i.e. bypassing the firewall in your router.

Safest practice is to keep your DMZ off unless you absolutely need it and your PC has its own firewall.
Topic archived. No new replies allowed.