开发者

Inconsistent connection failure with Twisted after py2exe

My first question here, so go easy on me.

This is my situation:

I am creating a networked game in Python using the Twisted framework. The game connects to a master server via TCP on one port (the connection is kept alive for authentication), and then you can join a network server on another port. Currently both the network and the master server programs are running on the same remote machine.

So far almost everything works great, at least when running the game through the Python interpreter. Connecting to both servers always works fine in that case. The problem only starts after creating a stand-alone executable for the client with py2exe.

On my development machine, running the executable will allow me to start the game, connect to the master server and authenticate with it. Wireshark tells me that the connection is kept alive and regular polls are being ACK'ed. So far so good. But when I try to connect to a network game server (second TCP connection on an adjacent port), the result is inconsistent. About one in a hundred times it will work. The rest of the time is about 50/50 between doing nothing at all (Twisted doesn't fire any callbacks), or returning a "User timeout caused connection failure." error within half a second.

The funny thing is, Wireshark doesn't even show any outgoing TCP packets for these failed connection "attempts", no matter whether they return an error or do nothing at all.

Then it gets weirder, because when I run the exact same game client executable on my other test machine, everything works fine. No connections issues there whatsoever, it just works every time. Both machines are running original Windows 7, the dev machine is on Professional, the other Home Edition.

I s开发者_运维技巧hould also point out that running the game server locally, even on the same machine as the client (connecting to "localhost") has no effect on this problem - the symptoms remain the same.

So what could possibly be going on here?


This sounds like a problem with your Windows network stack. Have you installed something that intentionally breaks networking, like AVG antivirus? If you have, your network may be broken :).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜