Learning python networking

William Ray Wing wrw at mac.com
Wed Jan 15 11:25:24 EST 2014


On Jan 15, 2014, at 7:52 AM, Chris Angelico <rosuav at gmail.com> wrote:

[megabyte]

> One of the fundamentals of the internet is that connections *will*
> break. A friend of mine introduced me to Magic: The Gathering via a
> program that couldn't handle drop-outs, and it got extremely
> frustrating - we couldn't get a game going. Build your server such
> that your clients can disconnect and reconnect, and you protect
> yourself against half the problem; allow them to connect and kick the
> other connection off, and you solve the other half. (Sometimes, the
> server won't know that the client has gone, so it helps to be able to
> kick like that.) It might not be an issue when you're playing around
> with localhost, and you could even get away with it on a LAN, but on
> the internet, it's so much more friendly to your users to let them
> connect multiple times like that.

But note VERY carefully that this can open HUGE security holes if not done with extreme care.

Leaving a dangling connection (not session, TCP closes sessions) open is an invitation so bad things happening.

-Bill


More information about the Python-list mailing list