예제 #1
0
 def data_received(self, data):
     try:
         self.conn.receive_data(data)
     except RemoteProtocolError as err:
         if err.event_hint is not None:
             self.transport.write(self.conn.send(err.event_hint))
             self.transport.close()
         else:
             self.handle_no_connect(events.CloseConnection())
     else:
         self.handle_events()
예제 #2
0
 def doclose(self):
     self._send(events.CloseConnection(code=0))