[Twisted-Python] disabling/resuming connections

Jp Calderone exarkun at intarweb.us
Sun Oct 12 16:33:05 EDT 2003


On Sun, Oct 12, 2003 at 11:18:59PM +0300, Ruslan Spivak wrote:
> Hello.
> 
> Is it possible programmatically tell my server to stop accept 
> connections from remote clients and then enable it programmatically when 
> i need?
> 
> I use PB based server.
> 

  If you are using PBServerFactory, it is easy --


    f = PBServerFactory(...)
    port = reactor.listenTCP(..., f)
    ...
    port.stopListening()
    ...
    port.startListening()
    ...


  If you're using the old PB API, I'm not sure how you'd do it.

  Jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20031012/4f97f3bf/attachment.pgp 


More information about the Twisted-Python mailing list