'Open port with current settings. This may throw a SerialException
if the port cannot be opened.'

def open(self):

    self.logger = None
    if (self._port is None):
        raise SerialException('Port    must    be    configured    before    it    can    be    used.')
    if self.is_open:
        raise SerialException('Port    is    already    open.')
    try:
        self._socket = socket.create_connection(self.from_url(self.portstr), timeout=POLL_TIMEOUT)
    except Exception as msg:
        self._socket = None
        raise SerialException('Could    not    open    port    {}:    {}'.format(self.portstr, msg))
    self._reconfigure_port()
    self.is_open = True
    if (not self._dsrdtr):
        self._update_dtr_state()
    if (not self._rtscts):
        self._update_rts_state()
    self.reset_input_buffer()
    self.reset_output_buffer()
