def _close_socket ( self ) : try : self . socket . shutdown ( socket . SHUT_RDWR ) except ( OSError , socket . error ) : pass self . socket . close ( )
close connection in server using sockets in python
Shutdown and close the Socket .
def _close_socket(self):
        """Shutdown and close the Socket.

        :return:
        """
        try:
            self.socket.shutdown(socket.SHUT_RDWR)
        except (OSError, socket.error):
            pass
        self.socket.close()