from twisted.internet import reactor def printMsg(): print 'test message' reactor.stop() reactor.callLater(0, printMsg) reactor.run() class MyProtocol(protocol.Protocol): made = 0 closed = 0 def connectionMade(self): self.made = 1 print self.transport.getPeer().host self.transport.loseConnection() def connectionLost(self, reason): self.closed = 1 print 'connection lost' class TCPClient(protocol.Cl
{{#tags}}- {{label}}
{{/tags}}