[Twisted-Python] Clossing one TCP connection

Carolina Ardohain carolinaardohain at gmail.com
Wed Apr 27 17:10:29 MDT 2005


I launch several connections using an object like this

class MyConnection()
  def __init__(host, port, factory):
    self.factory = factory
    self.connector = reactor.connectTCP(host, port, factory)

I create several connections

m1 = MyConnection('host1', 8000, MyFactory())
m2 = MyConnection('host2', 8000, MyFactory())

reactor.run()

Now I want to create a method onClose that close the connection,
something like reactor.stop() but that dont close the whole
application.




More information about the Twisted-Python mailing list