Jump to content
  • Advertisement
Sign in to follow this  
ben11587

Programming a connection to a user on a private network

This topic is 3595 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, how does one program a connection to a computer if it's on its own network that you are not on? That is, a computer with a local address of 192.168.0.2 but an IP address of 68.3.128.4. How do you connect to that computer? I'm using Winsock, not Berkely, but i don't think that matters.

Share this post


Link to post
Share on other sites
Advertisement
You either do port forwarding from the firewall that does NAT for the private network, or you use a third, "introducer" server to do NAT punch-through. See the Forum FAQ for more details.

Of course, if the private network isn't actually routable to the public internet, then you can't actually get to it -- there needs to be a working connection for the bits to travel through :-)

Share this post


Link to post
Share on other sites
That's the very best Forum FAQ i've ever seen. Very informative.
However, it did not solve my problem: i am trying to code a program that connects one person's home computer (in a network) to someone else's home computer (in a different network). I don't have the luxury of an external intermediary/introducer server to connect the two computers together-- both computers are behind NAT. Is there any hope?

Share this post


Link to post
Share on other sites
I don't know a lot about it, but windows comes with "remote assistance"
I've never used it before but I'm assuming it allows people behind routers to use it with out setting it up for port forwarding. If that's the case then there must be another way of doing this?
please someone correct me if I'm wrong on this.

Share this post


Link to post
Share on other sites
Quote:
Original post by A dam
I don't know a lot about it, but windows comes with "remote assistance"
I've never used it before but I'm assuming it allows people behind routers to use it with out setting it up for port forwarding. If that's the case then there must be another way of doing this?
please someone correct me if I'm wrong on this.

You're wrong on this. Remote Assistance can use uPNP to setup port forwarding, and can connect in either direction, but it's not magic. If both parties have NAT gateways and neither one supports uPNP, you're hosed.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
You're wrong on this. Remote Assistance can use uPNP to setup port forwarding, and can connect in either direction, but it's not magic. If both parties have NAT gateways and neither one supports uPNP, you're hosed.


well there i go, assuming Microsoft can do magic tricks again... but with all the horrible and unexplainable things my vista box does, it's hard not to imagine that they hire obscene wizards to write their code.

Share this post


Link to post
Share on other sites
Quote:
Original post by A dam
Quote:
Original post by Sneftel
You're wrong on this. Remote Assistance can use uPNP to setup port forwarding, and can connect in either direction, but it's not magic. If both parties have NAT gateways and neither one supports uPNP, you're hosed.


well there i go, assuming Microsoft can do magic tricks again... but with all the horrible and unexplainable things my vista box does, it's hard not to imagine that they hire obscene wizards to write their code.


Joel did an intern project last year that was aimed at solving the randevous problem. They host the server to make that happen.

Share this post


Link to post
Share on other sites
Quote:
Original post by A dam
well there i go, assuming Microsoft can do magic tricks again... but with all the horrible and unexplainable things my vista box does, it's hard not to imagine that they hire obscene wizards to write their code.
Now, to be fair, they DO do the UPNP trick, which is almost magic. More and more routers are shipping with it defaulting to enabled, so any software which would like to do port forwarding should probably be trying UPNP.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!