Exemple #1
0
 def close(self, reset=False):
     logger.info("Closing down clientserver connection")
     if not self.socket:
         return
     if reset:
         set_linger(self.socket)
     quiet_close(self.stream)
     if not reset:
         quiet_shutdown(self.socket)
     quiet_close(self.socket)
     already_closed = self.socket is None
     self.socket = None
     self.stream = None
     if not self.initiated_from_client and self.python_server and not already_closed:
         server_connection_stopped.send(self.python_server, connection=self)
Exemple #2
0
 def close(self, reset=False):
     logger.info("Closing down clientserver connection")
     if not self.socket:
         return
     if reset:
         set_linger(self.socket)
     quiet_close(self.stream)
     if not reset:
         quiet_shutdown(self.socket)
     quiet_close(self.socket)
     already_closed = self.socket is None
     self.socket = None
     self.stream = None
     if not self.initiated_from_client and self.python_server and\
             not already_closed:
         server_connection_stopped.send(self.python_server, connection=self)