| OLD | NEW |
| (Empty) |
| 1 # -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTestCase.test_l
oseConnection -*- | |
| 2 # Copyright (c) 2006-2007 Twisted Matrix Laboratories. | |
| 3 # See LICENSE for details. | |
| 4 | |
| 5 """ | |
| 6 Main program for the child process run by | |
| 7 L{twisted.test.test_stdio.StandardInputOutputTestCase.test_loseConnection} to | |
| 8 test that ITransport.loseConnection() works for process transports. | |
| 9 """ | |
| 10 | |
| 11 import sys | |
| 12 | |
| 13 from twisted.internet import stdio, protocol | |
| 14 from twisted.python import reflect | |
| 15 | |
| 16 class LoseConnChild(protocol.Protocol): | |
| 17 def connectionMade(self): | |
| 18 self.transport.loseConnection() | |
| 19 | |
| 20 | |
| 21 def connectionLost(self, reason): | |
| 22 reactor.stop() | |
| 23 | |
| 24 | |
| 25 if __name__ == '__main__': | |
| 26 reflect.namedAny(sys.argv[1]).install() | |
| 27 from twisted.internet import reactor | |
| 28 stdio.StandardIO(LoseConnChild()) | |
| 29 reactor.run() | |
| OLD | NEW |