View Full Version : connection refused
Hi... I've written a small networking arcade game and it works fine locally (127.0.0.1) and via lan... but when somebody tries to connect to a remote server of the game via internet the connect() returns "connection refused" and shuts down the game client... That's quite strange... never saw that before... There are no firewall rules, proxies, etc set on both sides of the conection but it still refuses to connect...
I've written some small tests just to check whether it is possible to connect at all... theses small programs interact perfectly...
There's no problem with the code of the game... It runs fine in lan space (via TCP/IP)...
But it goes down with internet...
Please help... What's the problem with it?
RobSeace
05-29-2003, 09:00 PM
You say there is no firewall in between them, but I have to
think you're wrong about that... If you can connect to the
machine from other machines on the LAN, but can't from a
machine off-LAN, I'd say that's pretty good evidence of some
kind of firewall or something blocking the off-LAN traffic...
Are you using publically addressable IPs on the machine you're
trying to reach, or is it behind a NAT box of some sort? Maybe
the NAT box isn't setup to forward incoming connections to that
machine for connections to whatever port you're using... Or, if
it's not NAT'd, then I'm guessing there's some firewall at your
gateway dropping the incoming connections (or, at their gateway,
dropping the outgoing, but I doubt it)... Some ISPs are also anal,
and block connections to certain ports for any of their users, too...
Can you connect to any other ports on any of the machines on
your LAN, from outside of it? Maybe try port-scanning the
machine from off-LAN, using "nmap" or something similar...
You could setup a packet sniffer, and see if the SYN is even
making it into your LAN, and being rejected by the actual
destination host, or if it's being rejected before it even gets there
(presumably by a firewall, somewhere enroute)...
You could get something like LFT (http://www.mainnerve.com/lft/), or some other TCP-based
traceroute-like program, which might help in tracking down the
actual source of the problem, too...
Hmmm... I've written some code to test it... it is a simple client, connecting to the machine and then disconnecting immediately... Everything goes fine when the server is on the lan, and the client is outside of it... The connection is established, everything is ok... And when the client is on the lan and the server is outside of it everything is ok too. (These small tests utilize the same port as the game client and server). But when i try a bigger application (my game) it can't connect...
That's REALLY strange...
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.