def shutdown ( self ) : if self . sock : self . sock . close ( ) self . sock = None self . connected = False
simulate cutting a socket connection python
close socket immediately .
def shutdown(self):
        """close socket, immediately."""
        if self.sock:
            self.sock.close()
            self.sock = None
            self.connected = False