Disconnects the client.
966285
public function disconnect()
    {
        if (!$this->connected) {
            return Promise\reject(new ConnectionException('Client not connected. Did you forget to call `connect()`?'));
        }

        $this->websocket->close();
        $this->connected = false;
    }
355383
def disconnect(self):
        ""
        self._parser.on_disconnect()
        try:
            self._writer.close()
        except Exception:
            pass
        self._reader = None
        self._writer = None
217120
private function disconnect()
    {
        if (is_resource($this->_conn)) {
            fclose($this->_conn);
        }
        $this->_auto_reconnect = false;
        $this->_conn = null;
    }
281848
private void disconnect(FTPClient client) throws IOException {
    if (client != null) {
      if (!client.isConnected()) {
        throw new FTPException("Client not connected");
      }
      boolean logoutSuccess = client.logout();
      client.disconnect();
      if (!logoutSuccess) {
        LOG.warn("Logout failed while disconnecting, error code - "
            + client.getReplyCode());
      }
    }
  }
1017407
@Override
  protected void disconnect()
  {
    ConnectionHttp conn = _request.connHttp();
    
    if (conn != null) {
      try {
        _request.ok();
        //conn.connTcp().writeStream().close();
        //conn.connTcp().disconnect();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
1338143
async def disconnect(self):
        
        self._connected = False

        await helpers._cancel(
            self._log,
            send_task=self._send_task,
            recv_task=self._recv_task
        )

        if self._writer:
            self._writer.close()
            if sys.version_info >= (3, 7):
                await self._writer.wait_closed()
1336785
protected void disconnect() {
		if (client != null) {
			try {
				client.stop();
			} catch (Exception ignored) {
			}
		}
		synchronized (publishers) {
			for (TopicPublisher publisher : publishers.values()) {
				try {
					publisher.close();
				} catch (Exception ignored) {
				}
			}
			publishers.clear();
		}
		synchronized (subscribers) {
			for (TopicSubscriber subscriber : subscribers.values()) {
				try {
					subscriber.close();
				} catch (Exception ignored) {
				}
			}
			subscribers.clear();
		}
		if (session != null) {
			try {
				session.close();
			} catch (Exception ignored) {
			}
			session = null;
		}
		if (client != null) {
			try {
				client.close();
			} catch (Exception ignored) {
			}
			client = null;
		}
	}
859588
def disconnect(self, reason):
        """"""
        self._server._disconnect_client(self._conn_key, self, reason)
438580
public void disconnect() {

		if (!connected) {
			return;
		}

		try {
			socket.close();
		} catch (IOException e) {
			LOG.debug("I/O exception when closing socket", e);
		}

		this.connected = false;
	}
699306
public void disconnect() {
        if (disconnected.compareAndSet(false, true)) {
            log.debug("Disconnect - id: {}", id);
            if (connections != null && !connections.isEmpty()) {
                log.debug("Closing {} scope connections", connections.size());
                // close all connections held to Red5 by client
                for (IConnection con : getConnections()) {
                    try {
                        con.close();
                    } catch (Exception e) {
                        // closing a connection calls into application code, so exception possible
                        log.error("Unexpected exception closing connection {}", e);
                    }
                }
            } else {
                log.debug("Connection map is empty or null");
            }
            // unregister client
            removeInstance();
        }
    }
825694
@Override
    public void disconnect() {
        log.debug("disconnect");
        if (conn != null) {
            streamDataMap.clear();
            conn.close();
        } else {
            log.info("Connection was null");
        }
    }
682744
private function destroyClient(): void
    {
        ++$this->reconnects;
        $this->client = null;
        $delay = mt_rand(0, (int)min(5000, (int)pow(2, $this->reconnects) * 100));
        usleep($delay * 1000);
    }
956610
def disconnect(self):
        """"""
        if self._connected:
            self._connected = False
            self._conn.disconnect()
400521
def disconnect(self):
        ""
        self._checkpid()
        all_conns = chain(self._available_connections,
                          self._in_use_connections)
        for connection in all_conns:
            connection.disconnect()
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")
848533
public function disconnect()
	{
		// Close the connection.
		if (\is_callable($this->connection, 'close'))
		{
			$this->connection->close();
		}

		$this->connection = null;
	}
959336
def disconnect(self):
        
        if self._state == _State.CONNECTED:
            self._state = _State.DISCONNECTING
            self._transport.loseConnection()
            return self._notify_on_disconnect()
        if self._state == _State.CONNECTING:
            return fail(ClientConnecting())
        elif self._state == _State.NOT_CONNECTED:
            return succeed(None)
        elif self._state == _State.DISCONNECTING:
            return self._notify_on_disconnect()