How to establish connection through internet

Started by
3 comments, last by Antheus 12 years ago
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.
Advertisement
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 :)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
if this is so its probably from my router

from the settings i dint find NAT loopback...
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 smile.png
telnet ip-to-connect-to port

Does that open a connection? If no, there might be a firewall issue.

Otherwise the problem lies in your code.

This topic is closed to new replies.

Advertisement