errno 111 connection refused

Im having problems setting up a TCP connection with python. whenever I try to connect the socket to the localhost or 127.0.0.1 I get an errno 111 connection refused message. I tried to run some blend files here on the forum that use socket and who are supposed to work but I get the same message there. I’m running the newest ubuntu version. Any idea what’s happening? I’m thinking the port gets blocked, but I haven’t installed any firewall, and I can’t find a way to open ports.
I’ve already lost a day trying to figure this one out and I’m getting a bit desperate

If you’re behind a router, you’ll need to set up some port forwarding.
The router is what decides which messages go where, so you need to set all incoming connections on certain ports to a specific internal IP address (the serving computer).

You can find lots of information about port forwarding on the internet.
Basically, you need to browse to your router settings page (served by the router at an address that typically looks something similar to “http://192.168.1.1/”), then find a way to forward either individual ports, or more conveniently, large ranges of ports.

If you’d like to check out a good example of networking in game blender, take a poke at Nanoshooter, which is me and Gomer’s online multiplayer game. Right now, the server is down for maintenance until we fix some shenanigans.

Good luck,
-Chaser

how do other multiplayer games work around this then? I don’t have problems on other online games, do they run a port check first to see which one is forwarded to the client? And is it doable to do this in python?
Thanks for your quick response anyway, I’ll take a look at your project. Good luck developing it!

I found the problem. My server was connecting to socket.gethostname, while my client was searching for the localhost. Apparently these are not the same. changing the socket.gethostname to ‘localhost’ solved the problem.