'Close port'

def close(self):

    if self.is_open:
        if self._socket:
            try:
                self._socket.shutdown(socket.SHUT_RDWR)
                self._socket.close()
            except:
                pass
            self._socket = None
        self.is_open = False
        time.sleep(0.3)
