Esempio n. 1
0
 def connectionMade(self):
     self.max_buffer_size = 104857600
     self.buffer = ""
     self.transport.pauseProducing()
     if hasattr(self.factory, "handler"):
         connection = Connection(self)
         self.attach(connection)
     self.transport.registerProducer(self, False)
     if hasattr(self.factory, "handler"):
         self.factory.handler(connection)
     if self.connect_cb:
         cb = self.connect_cb
         self.connect_cb = None
         cb(None)
Esempio n. 2
0
 def handle_accept(self):
     (conn, addr) = self.accept()
     connection = Connection(_Connection(sock=conn))
     connection._stack_conn.attach(connection)
     self.handler(connection)