Re: [Twisted-Python] Limiting number of concurrent client connections

Discussion in 'Python' started by Jp Calderone, Jun 28, 2005.

  1. Jp Calderone

    Jp Calderone Guest

    On Tue, 28 Jun 2005 10:47:04 +0100, Toby Dickenson <> 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
     
    Jp Calderone, Jun 28, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe
    Replies:
    0
    Views:
    2,354
  2. ivanova

    asyncore: limiting connections?

    ivanova, Jun 19, 2004, in forum: Python
    Replies:
    2
    Views:
    427
    ivanova
    Jun 19, 2004
  3. Jean-Paul Calderone
    Replies:
    0
    Views:
    468
    Jean-Paul Calderone
    Jun 17, 2008
  4. Glyph
    Replies:
    0
    Views:
    199
    Glyph
    Dec 27, 2012
  5. Glyph
    Replies:
    0
    Views:
    171
    Glyph
    Apr 3, 2013
Loading...

Share This Page