Sign in to follow this  
TreantBG

How to establish connection through internet

Recommended Posts

Hello.
I have created a simple game, and i want to make a online multiplayer mode.
I did understand how UDP or TCP/IP Socketing works (i have already made LAN mode to the game) BUT i seems fail to understand how to connect to another player via Internet with his global IP.

every my attempt to connect to my public IP has failed.

i want similar player connection like diablo 2 direct IP connection.

pls if you have examples post a link to them i will be very greadfull


P.S. ITS NOT a firewall problem or other of this kind.

Share this post


Link to post
Share on other sites
1) make sure you bind the listening socket to all addresses.
2) same as for LAN, if it doesn't work then it is a firewall/routing problem.

Also, many cheap routers (especially ones that include a DSL modem) will fail miserably if you try to connect to your own public IP from inside the LAN. (if you need to do this for testing purposes then either get a router that you can configure properly for this(usually the setting you want to enable is called NAT loopback) or place the server somewhere else while testing)

Thus most likely i'd say that it is actually a firewall/router problem despite your assurance of the opposite :)

Share this post


Link to post
Share on other sites
Most likely a router issue.

On the server end you, will need to forward the required port to the internal (LAN) IP address of the server.

The client will need to connect to you WAN ip address. If you dont know what that is, you can find it by typing 'what is my ip addesss' into google.
Google these days tells you what you IP address is, without having to go to a 3rd party site.


Hope this helps [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this