Client disconnected.
193893
public function onClose(ConnectionInterface $connection)
    {
        $client = $this->clients->findByConnection($connection);

        if ($client) {
            $this->clients->remove($client);

            $this->command->info('Client disconnected');

            // Fire the event.
            Event::fire(new ClientDisconnected($this->server, $this->clients, $client));
        }
    }
348289
@Disconnect
    public void onDisconnect(AtmosphereResourceEvent event) {
        if (event.isCancelled()) {
            // We didn't get notified, so we remove the user.
            users.values().remove(event.getResource().uuid());
            logger.info("Browser {} unexpectedly disconnected", event.getResource().uuid());
        } else if (event.isClosedByClient()) {
            logger.info("Browser {} closed the connection", event.getResource().uuid());
        }
    }
56137
async def _on_websocket_disconnect(self, _event):
        """"""

        self.logger.info('Forcibly disconnected from the WebSocket server')

        conns = self._connections.copy()
        for conn_id in conns:
            conn_string = self._get_property(conn_id, 'connection_string')
            self._teardown_connection(conn_id)
            self.notify_event(conn_string, 'disconnect', "Websocket connection closed")
363698
def _client_connection(self, conn, addr):
        '''
        
        '''
        log.debug('Established connection with %s:%d', addr[0], addr[1])
        conn.settimeout(self.socket_timeout)
        try:
            while self.__up:
                msg = conn.recv(self.buffer_size)
                if not msg:
                    # log.debug('Received empty message from %s', addr)
                    # disabled ^ as it was too noisy
                    continue
                log.debug('[%s] Received %s from %s. Adding in the queue', time.time(), msg, addr)
                self.buffer.put((msg, '{}:{}'.format(addr[0], addr[1])))
        except socket.timeout:
            if not self.__up:
                return
            log.debug('Connection %s:%d timed out', addr[1], addr[0])
            raise ListenerException('Connection %s:%d timed out' % addr)
        finally:
            log.debug('Closing connection with %s', addr)
            conn.close()
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();
}
86754
def disconnect(self):
        """"""
        self.logger.info("DISCONNECT")
        if self.sock == NC.INVALID_SOCKET:
            return NC.ERR_NO_CONN
        self.state = NC.CS_DISCONNECTING
        
        ret = self.send_disconnect()
        ret2, bytes_written = self.packet_write()

        self.socket_close()
        return ret
687122
function shutdown(callback) {
  var closed = 0;
  var connected = clients ? clients.length : 0;

  function maybeFinished() {
    if(++closed >= connected) {
      clients = null;
      log.info('[Shutdown] All client connections safely closed.');
      return callback();
    }

    log.info('[Shutdown] Closed client %s of %s.', closed, connected);
  }

  if(!connected) {
    return maybeFinished();
  }

  var client;

  for(var i = 0; i < connected; i++) {
    client = clients[i] || null;

    if(!client) {
      maybeFinished();
    } else {
      client.once('closed', maybeFinished);

      if(client.state !== States.CLOSING && client.state !== States.CLOSED) {
        client.close();
      }
    }
  }
}
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")
147360
def on_disconnect(self, code, stream_name, reason):
        """"""
        logger.error('Disconnect message: %s %s %s', code, stream_name, reason)
        return True
1085478
function disconnect(cb) {
  if (connection) {
    log.logger.debug('Mongoose disconnected');
    connection.close(cb);
  } else {
    cb();
  }
}
1090370
function(client, callback) {
    logger.entry('Client.stop.performDisconnect', client.id);

    // If this client is still starting, then wait until the state changes
    // before we attempt to stop.
    if (client.state === STATE_STARTING) {
      var stillConnecting = function(client) {
        logger.entry('stillConnecting', client.id);

        if (client.state === STATE_STARTING) {
          setImmediate(function() {
            stillConnecting(client);
          });
        } else {
          process.nextTick(function() {
            performDisconnect(client, callback);
          });
        }

        logger.exit('stillConnecting', client.id, null);
      };

      setImmediate(function() {
        stillConnecting(client);
      });
      logger.exit('Client.stop.performDisconnect', client.id, null);
      return;
    }

    client._setState(STATE_STOPPING);

    if (client._serviceFunctionTimeout) {
      // if we previously set a timeout to retry the serviceFunction, clear it.
      clearTimeout(client._serviceFunctionTimeout);
    }
    client._serviceFunctionTimeout = null;

    // Only disconnect when all outstanding send operations are complete
    if (client._outstandingSends.length === 0) {
      stopMessenger(client, function(client, callback) {
        logger.entry('Client.stop.performDisconnect.stopProcessing',
            client.id);
        // clear queuedSends as we are disconnecting
        var messages = [];
        while (client._queuedSends.length > 0) {
          messages.push(client._queuedSends.shift());
        }
        // call the msg callbacks in error as we have disconnected
        process.nextTick(function() {
          logger.entry('Client.stop.performDisconnect.' +
              'stopProcessing.queuedSendCallback', client.id);
          while (messages.length > 0) {
            var msg = messages.shift();
            if (msg.callback) {
              msg.callback(new StoppedError('send aborted due to client stop'));
            }
          }
          logger.exit('Client.stop.performDisconnect.' +
              'stopProcessing.queuedSendCallback', client.id, null);
        });
        // Clear the active and queued subscriptions lists as we were
        // asked to disconnect.
        logger.log('data', client.id, 'client._subscriptions:',
                   client._subscriptions);
        while (client._subscriptions.length > 0) {
          client._subscriptions.shift();
        }
        while (client._queuedSubscriptions.length > 0) {
          client._queuedSubscriptions.shift();
        }
        // Close our end of the socket
        if (client._stream) {
          client._stream.removeAllListeners('close');
          client._stream.end();
          client._stream = null;
        }
        client._queuedChunks = [];
        client._queuedChunksSize = 0;

        // Indicate that we've disconnected
        client._setState(STATE_STOPPED);
        // Remove ourself from the active client list
        var activeClient = activeClientList.get(client.id);
        if (client === activeClient) activeClientList.remove(client.id);
        setImmediate(function() {
          if (!client._firstStart) {
            client._firstStart = true;
            logger.log('emit', client.id, STATE_STOPPED);
            client.emit(STATE_STOPPED);
          }
        });
        if (callback) {
          process.nextTick(function() {
            logger.entry('Client.stop.performDisconnect.stopProcessing.' +
                'callback', client.id);
            callback.apply(client);
            logger.exit('Client.stop.performDisconnect.stopProcessing.' +
                'callback', client.id, null);
          });
        }

        logger.exit('Client.stop.performDisconnect.stopProcessing',
            client.id, null);
      }, callback);

      logger.exit('Client.stop.performDisconnect', client.id, null);
      return;
    }

    // try disconnect again
    setImmediate(performDisconnect, client, callback);

    logger.exit('Client.stop.performDisconnect', client.id, null);
  }
1031766
private void disconnect(AFTPClient client) {
	try {
	    if (client != null && client.isConnected()) {
		client.quit();
		client.disconnect();
	    }
	}
	catch (IOException ioe) {}
    }
203036
@Override
    public synchronized void disconnect() {
        if (connectSession != null) {
            logger.debug("Disconnecting client connection.");
            connectSession.disconnect();
            connectSession = null;
        }
    }
1698
def cleanup(self):
        

        while self.inactive_timeout > 0:
            self.time = time.time()

            keys = []

            for key, client in self.clients.items.items():
                t = getattr(client, "active_at", 0)
                if t > 0 and self.time - t > self.inactive_timeout:
                    client.kwargs["link"].disconnect()
                    keys.append(key)

            for key in keys:
                self.log_debug("Removing client (inactive): %s" % key)
                del self.clients[key]

            time.sleep(1)
1125242
@Override
  public synchronized void disconnect() {
    try {
      // If there is an error with the handler, dont bother logging out.
      if (!mailClientHandler.isHalted()) {
        if (mailClientHandler.idleRequested.get()) {
          log.warn("Disconnect called while IDLE, leaving idle and logging out.");
          done();
        }

        // Log out of the IMAP Server.
        channel.write(". logout\n");
      }

      currentFolder = null;
    } catch (Exception e) {
      // swallow any exceptions.
    } finally {
      // Shut down all channels and exit (leave threadpools as is--for reconnects).
      // The Netty channel close listener will fire a disconnect event to our client,
      // automatically. See connect() for details.
      try {
        channel.close().awaitUninterruptibly(config.getTimeout(), TimeUnit.MILLISECONDS);
      } catch (Exception e) {
        // swallow any exceptions.
      } finally {
        mailClientHandler.idleAcknowledged.set(false);
        mailClientHandler.disconnected();
        if (disconnectListener != null)
          disconnectListener.disconnected();
      }
    }
  }
208916
def on_disconnect(self):
        ""
        if self._sock is not None:
            self._sock.close()
            self._sock = None
        if self._buffer is not None:
            self._buffer.close()
            self._buffer = None
        self.encoding = None
1252347
def on_disconnect(client):
    
    print "-- Lost connection to %s" % client.addrport()
    CLIENT_LIST.remove(client)
    broadcast('%s leaves the conversation.\n' % client.addrport() )