InternetSession example

Previous topic - Next topic

MrTAToad

I'm trying to get an online lobby system up and running and was looking at the InternetSession example.  However, for some reason, in that example, NETJOINGAME always returns 0 when using my internet IP (although works fine over LAN).

I've tried disabling all firewalls on the computer and the only possibility is that the router is blocking connection.  Unfortunately the router has no option to disabling the internal firewall or port forwarding :(


MrTAToad

#2
Unfortunately no, it didn't help... It sends but doesn't receive...

I had thought the router was being funny, but alas a reset didn't help.

It is the ISP IP address that should be used, isn't it ? :)

Moru

If the UDP example doesn't work, you need to buy yourself a proper router :-)

MrTAToad


Kitty Hello

Try manually connnecting to that computer (SOCK_CONNECT_TCP or so). Does that work? It's a bug in NETJOIN then.
If your router has no firewall settings it sounds like there is none.

The NET... commands only use TCP.

MrTAToad

Directly connecting to a LAN computer works fine

quangdx

Without PortForwarding on your router,
when a computer sends data to your WAN address,
it will get to your router then not know where to go.
The port forwarding would take that data and using the Port number as an ID,
send it to the correct IP address of the computer on the LAN.

The only way you could get it to work, is to connect your Server computer directly to the internet,
so ALL network traffic goes directly to it.

But yeah, a proper router with PortForwarding is what you need.
Asobi tech - the science of play.
Spare time indiegame developer.

Moru

#8
With most home routers there is no need to use port forwarding. All that is needed is UDP hole punching and knowledge of the external IP of both client and server.

Client sends UDP data to server IP on port X.
Server sends UDP data to client IP on port X.
Router automatically opens up tunnel between Client IP and Server IP on port X. (Some routers aren't so picky about it communicating with the right IP so anyone can send data in on this port).

This tunnel stays up for a few seconds until there is no more data being transmitted on this port X.
First few packets will be lost while router sets up the tunnel but the rest goes straight trough.

Tried this already with Quake 2 and worked fine to get through a linux router distribution we were using at the time. Properly secured according to the resident linux-gurus :-)