views:

21

answers:

2

I have a local server written in C++ listening to inbound TCP connects using plain socket ::accept() and UDP recvfrom(). I have two problems with this that I wish to solve:

  • Can I programatically make Windows let me open the accept socket without it automatically being blocked by the Windows (software) firewall?
  • Are there any ports I can use that will allow my packets to pass through both Windows firewall and external firewall? Port 80 is often taken by things like Skype, but are there others? Will most external firewalls typically by default allow incoming UDP and TCP connects on port 80?

Thanks!

+1  A: 

In general, network routers need Port Forwardng enabled for the listening port, and firewalls need the listening port opened. If you are using a uPNP-enabled firewall/router, then you can dynamically set up those settings programmmably via the uPNP API. But more times than not, uPNP is either disabled or unavailable, requiring manual settings by the firewll/router admin.

Remy Lebeau - TeamB
+1  A: 

You probably want to look at something more conducive to desktop environments such NAT traversal techniques as libjingle, STUN, or an overlay network such as XMPP.

Steve-o
Interesting stuff I never heard of; will look into it.
Jonas Byström