Disconnect from the serial port
548656
def disconnect(self):
        '''
        
        '''
        if self._poll_stop_event:
            self._poll_stop_event.set()
        if self._driver:
            if self.status != 'idle':
                self.deactivate()
            self._driver.disconnect()
345739
def _on_disconnect(self):
        

        self._logger.info("Connection to device %s was interrupted", self.connection_string)
        self.connection_interrupted = True
1145509
def _connect(self):
        """"""
        try:
            while True:
                _LOGGER.info('Trying to connect to %s', self.port)
                try:
                    yield from serial_asyncio.create_serial_connection(
                        self.loop, lambda: self.protocol, self.port, self.baud)
                    return
                except serial.SerialException:
                    _LOGGER.error('Unable to connect to %s', self.port)
                    _LOGGER.info(
                        'Waiting %s secs before trying to connect again',
                        self.reconnect_timeout)
                    yield from asyncio.sleep(
                        self.reconnect_timeout, loop=self.loop)
        except asyncio.CancelledError:
            _LOGGER.debug('Connect attempt to %s cancelled', self.port)
709478
def close(self):
                
        self.alive = False
        self.rxThread.join()
        self.serial.close()
1189548
def disconnect
      begin
        begin
          # try to call SSL::SSLSocket#io.
          @sock.io.shutdown
        rescue NoMethodError
          # @sock is not an SSL::SSLSocket.
          @sock.shutdown
        end
      rescue Errno::ENOTCONN
        # ignore `Errno::ENOTCONN: Socket is not connected' on some platforms.
      rescue Exception => e
        @receiver_thread.raise(e)
      end
      @receiver_thread.join
      synchronize do
        unless @sock.closed?
          @sock.close
        end
      end
      raise e if e
    end
400521
def disconnect(self):
        ""
        self._checkpid()
        all_conns = chain(self._available_connections,
                          self._in_use_connections)
        for connection in all_conns:
            connection.disconnect()
124456
def close(self, _force_lock=False):
        
        if not self.closed:
            with self.__force_lock(_force_lock) or self._serial_lock:
                self._serial.close()
                self.__used_ports.remove(self.port)

            logger.info("Closing port '%s'", self.port,
                        extra={'port': self.port,
                               'baudrate': self.baudrate,
                               'timeout': self.timeout})
1116763
def disconnect(self):
        
        if self._driver:
            self._driver.disconnect()

        self.axis_homed = {
            'x': False, 'y': False, 'z': False, 'a': False, 'b': False}
1156553
def disconnect(self):
        
        if self.connected:
            self._socket.close()
            self._socket = None
            self.connected = False
1366806
def disconnect(self):
      

      if not self.sascfg.reconnect:
         return "Disconnecting and then reconnecting to this workspaceserver has been disabled. Did not disconnect"

      pgm = b'\n'+b'tom says EOL=DISCONNECT                      \n'
      self.stdin[0].send(pgm)

      while True:
         try:
            log = self.stderr[0].recv(4096).decode(errors='replace')
         except (BlockingIOError):
            log = b''

         if len(log) > 0:
            if log.count("DISCONNECT") >= 1:
               break

      return log.rstrip("DISCONNECT")
596672
public void disconnect() {
		if (sendThread != null) {
			sendThread.interrupt();
			try {
				sendThread.join();
			} catch (InterruptedException e) {
			}
			sendThread = null;
		}
		if (receiveThread != null) {
			receiveThread.interrupt();
			try {
				receiveThread.join();
			} catch (InterruptedException e) {
			}
			receiveThread = null;
		}
		if(transactionCompleted.availablePermits() < 0)
			transactionCompleted.release(transactionCompleted.availablePermits());
		
		transactionCompleted.drainPermits();
		logger.trace("Transaction completed permit count -> {}", transactionCompleted.availablePermits());
		if (this.serialPort != null) {
			this.serialPort.close();
			this.serialPort = null;
		}
		logger.info("Disconnected from serial port");
	}
558332
def halt(self):
        
        if self._callback:
            self._running.clear()
            self._ioloop.remove_handler(self.serial.fd)

            if self._frame_future is not None:
                self._frame_future.set_result(None)
                self._frame_future = None
582378
def remove_connection(self, interface1, interface2):
        """"""

        uri = "api/interface/disconnect/%s/%s/" % (interface1, interface2)

        return self.delete(uri)
1150517
def disconnect(self):
        """"""
        self._state_mutex.acquire()
        self._state = mqtt_cs_disconnecting
        self._state_mutex.release()

        self._backoffCore.stopStableConnectionTimer()

        if self._sock is None and self._ssl is None:
            return MQTT_ERR_NO_CONN

        return self._send_disconnect()
915629
def disconnect(self):
        """"""
        if self.pipeline:
            self._send(*self.pipeline)
        self.pipeline = None
654128
def disconnect(self):
        ""
        self._parser.on_disconnect()
        if self._sock is None:
            return
        if self._selector is not None:
            self._selector.close()
            self._selector = None
        try:
            if os.getpid() == self.pid:
                self._sock.shutdown(socket.SHUT_RDWR)
            self._sock.close()
        except socket.error:
            pass
        self._sock = None
575324
def disconnect(self, slot):
        """"""
        if self.is_connected(slot):
            self.slots.remove(slot)