parameters: (self)
docstring: Close port
docstring_summary: Close port
docstring_tokens: Close port
function: def close(self):
          """Close port"""
          if self._isOpen:
              if self._socket:
                  try:
                      self._socket.shutdown(socket.SHUT_RDWR)
                      self._socket.close()
                  except:
                      # ignore errors.
                      pass
                  self._socket = None
              self._isOpen = False
              # in case of quick reconnects, give the server some time
              time.sleep(0.3)
function_tokens: def close ( self ) : if self . _isOpen : if self . _socket : try : self . _socket . shutdown ( socket . SHUT_RDWR ) self . _socket . close ( ) except : # ignore errors. pass self . _socket = None self . _isOpen = False # in case of quick reconnects, give the server some time time . sleep ( 0.3 )