Disconnect from server.
425442
async def disconnect(self, expected=True):
        
        if self.connected:
            # Unschedule ping checker.
            if self._ping_checker_handle:
                self._ping_checker_handle.cancel()

            # Schedule disconnect.
            await self._disconnect(expected)
962759
def _on_client_disconnect(self, data):
        """"""
        self._clients[data.get('id')].update_connected(False)
        _LOGGER.info('client %s disconnected', self._clients[data.get('id')].friendly_name)
1197990
def disconnect(self):
        
        if not self.is_connected() and not self.is_connecting():
            return
        LOG.debug("disconnecting from %s...", self._redis_server())
        self.__periodic_callback.stop()
        try:
            self._ioloop.remove_handler(self.__socket_fileno)
            self._listened_events = 0
        except Exception:
            pass
        self.__socket_fileno = -1
        try:
            self.__socket.close()
        except Exception:
            pass
        self._state.set_disconnected()
        self._close_callback()
        LOG.debug("disconnected from %s", self._redis_server())
1096811
def disconnect(self):
    """"""
    if self.sock is not None:
      try:
        self.sock.close()
      except socket.error:
        pass
      finally:
        self.sock = None
1144835
def on_disconnect(self):
        ""
        self._sock = None
        if self._buffer is not None:
            self._buffer.close()
            self._buffer = None
        self.encoder = None
1085478
function disconnect(cb) {
  if (connection) {
    log.logger.debug('Mongoose disconnected');
    connection.close(cb);
  } else {
    cb();
  }
}
1170643
protected void disconnect() {

		// Stop broadcaster
		if (locator != null) {
			locator.disconnect();
			locator = null;
		}

		// Stop gossiper's timer
		if (gossiperTimer != null) {
			gossiperTimer.cancel(false);
			gossiperTimer = null;
		}

		// Close socket reader
		if (reader != null) {
			reader.disconnect();
			reader = null;
		}

		// Close socket writer
		if (writer != null) {
			writer.disconnect();
			writer = null;
		}
	}
202618
def server_off(self):
        '''  '''
        if (self.server.is_server_running() == 'yes' or
                self.server.is_server_running() == 'maybe'):
            self.server.shutdown()
            print 'Please wait. This could take a few seconds.'
            time.sleep(0.5)
67435
public function disconnect()
     {
         if (is_resource($this->socket)) {
             @socket_shutdown($this->socket, 2);
             @socket_close($this->socket);
         }
         $this->socket = null;
         $this->loginStatus = Constants::DISCONNECTED_STATUS;
         $this->logFile('info', 'Disconnected from WA server');
         $this->eventManager()->fire('onDisconnect',
             [
                 $this->phoneNumber,
                 $this->socket,
             ]
         );
     }
629251
def close(self):
        """"""
        try:
            try:
                self.connection.quit()
            except socket.sslerror:
                # This happens when calling quit() on a TLS connection
                # sometimes.
                self.connection.close()
            except Exception as e:
                logger.error(
                    "Error trying to close connection to server " "%s:%s: %s",
                    self.host,
                    self.port,
                    e,
                )
                if self.fail_silently:
                    return
                raise
        finally:
            self.connection = None
70829
def disconnect(self):
        
        self.ws.close()
        self.ingame = False
        self.subscriber.on_sock_closed()
997528
public void disconnect() {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Disconnecting client for session: 0x"
                    + Long.toHexString(getSessionId()));
        }

        sendThread.close();
        eventThread.queueEventOfDeath();
    }
888724
def _disconnect(self):
        
        try:
            self._connection.close()
            logger.debug("Disconnected from rabbit")
        except Exception:
            logger.exception("Unable to close connection")
791556
public void disconnect() {
        if (socket != null) {
            try {
                socket.close();
            }
            catch (IOException ioe) {

                // Does not matter, I guess.
            }
            socket = null;
        }
        connected = false;
    }
460227
function disconnect() {
  var force = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
  var cb = arguments.length <= 1 || arguments[1] === undefined ? undefined : arguments[1];

  console.log('Disconnecting client: ' + clientId);
  stopPub = true;
  client.end(force, cb);
}
1208575
def disconnect(self):
        """"""
        self.chain.connection.log("Disconnecting: {}".format(self))
        if self.connected:
            if self.protocol:
                if self.is_console:
                    while self.mode != 'global':
                        try:
                            self.send('exit', timeout=10)
                        except CommandTimeoutError:
                            break

                self.protocol.disconnect(self.driver)
                self.protocol = None

            self.connected = False
            self.ctrl = None
644007
def disconnect(self):
        """"""

        if not self.connected:
            return
        self.connected = False

        self.connection.disconnect()

        if self._heartbeat_loop:
            self._heartbeat_loop.kill()
        self._recv_loop.kill()

        self._reset_attributes()

        self.emit(self.EVENT_DISCONNECTED)