Hi all,
I'm writing a MUD server, and I want a way for transports to be notified ofa shutdown before being disconnected, and the reactor being stopped.

I've tried:

for t in transports:
 t.write('Shutting down.\r\n')
 t.loseConnection()
reactor.stop()

This doesn't seem to notify the transports.

I also tried:
for t in transports:
 t.write('Shutting down.\r\n')
 t.loseConnection()
 while t.connected:
  pass
reactor.stop()

That just blocked and did nothing, presumably something do with my while loop.

Is there a stopWhenEmpty function on the somewhere? I did look over the methods, and I couldn't find anything promising.

I'm just using the standard from twisted.internet import reactor reactor, so no special cases here. In case it matters the transports I'm using are twisted.protocols.basic.LineReceiver, and everything else works with them.

Cheers in advance for the help.

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to