Handle client disconnect.
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)
414330
def connectionLost(self, reason):
        
        if self._disconnectCBs:
            for cb in self._disconnectCBs:
                cb(self, reason)
260474
private void handleDisconnectEvent(DisconnectEvent disconnectEvent)
    {
        // reset version information as it might have changed while Asterisk
        // restarted
        version = null;
        versions = null;

        // same for channels, agents and queues rooms, they are reinitialized
        // when reconnected
        channelManager.disconnected();
        agentManager.disconnected();
        meetMeManager.disconnected();
        queueManager.disconnected();
        initialized = false;
        initializing = false;
    }
789186
def finish(self):
        
        log.info('Client disconnected: %s', self.client_ident())
        response = ':%s QUIT :EOF from client' % self.client_ident()
        for channel in self.channels.values():
            if self in channel.clients:
                # Client is gone without properly QUITing or PARTing this
                # channel.
                for client in channel.clients:
                    client.send_queue.append(response)
                channel.clients.remove(self)
        if self.nick:
            self.server.clients.pop(self.nick)
        log.info('Connection finished: %s', self.client_ident())
646843
function onDISCONNECT(self, reason, code, desc, lang) { // Client/Server
  if (code !== DISCONNECT_REASON.BY_APPLICATION) {
    var err = new Error(desc || reason);
    err.code = code;
    self.emit('error', err);
  }
  self.reset();
}
276891
def disconnect(self):
        """"""

        if not self.connected:
            raise HardwareError("Cannot disconnect when we are not connected")

        # Close the streaming and tracing interfaces when we disconnect
        self._reports = None
        self._traces = None

        self._loop.run_coroutine(self.adapter.disconnect(0))
        self.connected = False
        self.connection_interrupted = False
        self.connection_string = None
922459
public function disconnect() {
		$this->log->log("Disconnecting...",  XMPPHP_Log::LEVEL_VERBOSE);
		if(false == (bool) $this->socket) {
			return;
		}
		$this->reconnect = false;
		$this->send($this->stream_end);
		$this->sent_disconnect = true;
		$this->processUntil('end_stream', 5);
		$this->disconnected = true;
	}
551312
async def disconnect(self):
        """"""
        self._data = await self._handler.disconnect(
            system_id=self.node.system_id, id=self.id)
824936
def disconnect(self):
        

        if self.connection_receive:
            self.connection_receive.close()
        if self.connection_respond:
            self.connection_respond.close()
        if self.connection_send:
            self.connection_send.close()
488533
def disconnect(self):
        """"""
        self.target_device.disconnect()
        self.ctrl.disconnect()
        self.tail_disconnect(-1)
209923
def disconnect(self):
        

        if self.session.transitions.is_connected():
            if not self._disconnect_task.done():
                self._disconnect_task.cancel()
            yield from self._handler.mqtt_disconnect()
            self._connected_state.clear()
            yield from self._handler.stop()
            self.session.transitions.disconnect()
        else:
            self.logger.warning("Client session is not currently connected, ignoring call")
102665
def on_disconnect(self):
        ""
        if self._stream is not None:
            self._stream = None
        if self._buffer is not None:
            self._buffer.close()
            self._buffer = None
        self.encoding = None
217120
private function disconnect()
    {
        if (is_resource($this->_conn)) {
            fclose($this->_conn);
        }
        $this->_auto_reconnect = false;
        $this->_conn = null;
    }
1243770
def disconnect(self):
        """"""
        for signal, kwargs in self.connections:
            signal.disconnect(self, **kwargs)
630131
def disconnect(self):
        """"""
        self.canvas.mpl_disconnect(self._cidmotion)
        self.canvas.mpl_disconnect(self._ciddraw)
1096811
def disconnect(self):
    """"""
    if self.sock is not None:
      try:
        self.sock.close()
      except socket.error:
        pass
      finally:
        self.sock = None
9121
def closed(self, reason):
        """"""
        self.client.remove_connection(self)
        self.protocol.connection_lost(reason)
        if not isinstance(reason, ConnectionClosed):
            logger.warn("connection closed, reason {}".format(reason))
        else:
            logger.info("connection closed")