On Tue, 28 Jun 2005 10:47:04 +0100, Toby Dickenson <[EMAIL PROTECTED]> wrote:
>Im finding that Win32Reactor raises an exception on every iteration of the
>main loop if I exceed the limit of 64 WaitForMultipleObjects.
>
>I would prefer to avoid this fairly obvious denial-of-service problem by
>limiting the number of concurrent client connections. Is there a standard
>solution for this?
>

Count the number of connections you have accepted.  When you get up to 62 or 63 
or so, stop accepting new ones.  If ServerFactory.buildProtocol() returns None, 
Twisted immediately closes the accepted connection.  If you do this (perhaps in 
conjunction with calling stopListening() on the port returned by listenXYZ()), 
you'll never overrun the 64 object limit.

Jp
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to