[Twisted-Python] reactor.stop if no any clients
29 Sep
2010
29 Sep
'10
7:40 p.m.
If we stop listening, how can i wait while all client connection (which was accepted before stopListening) processed and then call reactor.stop?
29 Sep
29 Sep
7:52 p.m.
On Wed, Sep 29, 2010 at 6:40 PM, ruslan usifov <ruslan.usifov@gmail.com> wrote:
If we stop listening, how can i wait while all client connection (which was accepted before stopListening) processed and then call reactor.stop?
In your factory, keep a count of the number of clients you have and whether stopListening has been called. In your protocol's connectionLost() method, decrease that count by one and check to see if it's zero. If it's zero, and stopListening has been called, call reactor.stop(). jml
5128
Age (days ago)
5128
Last active (days ago)
1 comments
2 participants
participants (2)
-
Jonathan Lange
-
ruslan usifov