Bidirectional Networking

Brian Allen Vanderburg II BrianVanderburg2 at
Sun Dec 14 03:40:00 CET 2008

manu3d at wrote:
> On Dec 13, 11:13 pm, Bryan Olson <fakeaddr... at> wrote:
>> Software firewalls will often simply refuse incoming connections. The
>> basic protection of the garden-variety home router comes from "network
>> address translation" (NAT), in which case TCP connections initiated from
>> the inside will generally work, regardless of port, and incoming
>> connections will fail.
> Ok, I think I'm getting the picture here. So this means that in most
> circumstances where the data flow from the server is frequent the
> client initiates the connection, usually requests some initial data
> and keeps polling the server periodically, issuing new requests. In
> this context can the client simply keep the connection alive and
> listen for new data from the server coming at any time rather than
> actively issuing requests? Are there drawbacks to this strategy? I.e.
> is there a limit to the number of simultaneous connections a server
> can keep alive? I've noticed that the socket pages mention a 5
> connections limit. Is that it? What if I want to make a virtual room
> with 20 people connected simultaneously?

I've done some network programming not much.  I think if you need to 
receive update from a server frequently a constant connection would be 
better than connect-request-disconnect.  As for the backlog (5), this 
doesn't mean that you can only have a maximum of 5 established 
connections.  Each established connection gets a new socket object.  But 
what I think it means is that during the listen for an incoming 
connection on the listening socket, if multiple connection attempts are 
coming in at one time it can keep a backlog of up to 5 of these 
connection attempts for that individual socket.

Brian Vanderburg II

More information about the Python-list mailing list