Disconnects from chatserver and releases all resources.
194755
public void disconnect() {
		connection.getRoster().removeRosterListener(leagueRosterListener);
		try {
			connection.disconnect();
		} catch (final NotConnectedException e) {
			e.printStackTrace();
		}
		stop = true;
	}
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()
1233192
public void logout() {
        if (vimService != null) {
            try {
                serviceInstance.getSessionManager().logout();
            }
            catch (Exception e) {
                System.err.println("Failed to disconnect...");
            }
            vimService = null;
            serviceInstance = null;
        }
    }
496904
def teardown(self):
        
        while self._http_clients:
            self._http_clients.pop().close()
        if self.created:
            self.halt()
159714
public function Disconnect( )
		{
			$this->Connected = false;
			$this->Challenge = 0;
			
			$this->Socket->Close( );
			
			if( $this->Rcon )
			{
				$this->Rcon->Close( );
				
				$this->Rcon = null;
			}
		}
421617
private function shutdown(): void
    {
        $this->connectionPool->shutdown();

        foreach ($this->connectionHandlers as $connectionHandler) {
            $connectionHandler->shutdown();
        }

        while ($this->connectionPool->count() > 0) {
            $this->processConnectionPool();
        }

        $this->connectionPool->close();
    }
1233190
def close(self):
        
        keys = set(self._conns.keys())
        for key in keys:
            self.stop_socket(key)

        self._conns = {}
195168
@Override
    synchronized public void cleanup() {
        LOGGER.info("Cleanup the DirectorySocket.");

        if(task != null){
            task.toStop();
            task = null;
        }

        if(client != null){
            try {
                client.stop();
            } catch (Exception e) {
                LOGGER.warn("Close WebSocketClient get exception.", e);
            }
            client = null;
        }

        try {
            if(session != null){
                session.close();
            }
        } catch (IOException e) {
            LOGGER.warn("Close the WebSocket Session get exception.", e);
        }

        if(sessionFuture != null){
            try {
            sessionFuture.cancel(true);
            } catch (Exception e) {
                // do nothing
            }
        }

        session = null;
        sessionFuture = null;
        websocketStarted = false;
        connected = false;
        isStarted = false;
    }
228148
def close(self):
        ''''''
        # Flush any unsent message
        try:
            while self.pending():
                self.flush()
        except socket.error:
            pass
        with self._socket_lock:
            try:
                if self._socket:
                    self._socket.close()
            finally:
                self._reset()
1301795
public function disconnect()
    {
        if (!is_array($this->conn) || !count($this->conn)) {
            return;
        }

        foreach ($this->conn as $conn) {
            Connection::close($conn);
        }
    }
801243
def _finalCleanup(self):
        
        for conn in self._connections.values():
            conn.releaseConnectionResources()
        assert not self._connections
399684
def disconnect(self):
        
        if self._shell:
            self._shell.close()
            self._shell = ""
        if isinstance(self._session, manager.Manager):
            self._session.close_session()
        elif isinstance(self._session, paramiko.client.SSHClient):
            self._session.close()
            self._session = ""
        elif isinstance(self._session, SCPClient):
            self._session.close()
            self._session = ""
            self._scp = ""
908985
def disconnect(self, message=""):
        
        try:
            del self.connected
        except AttributeError:
            return

        self.quit(message)

        self.transport.close()

        self._handle_event(Event("disconnect", self.server, "", [message]))
217120
private function disconnect()
    {
        if (is_resource($this->_conn)) {
            fclose($this->_conn);
        }
        $this->_auto_reconnect = false;
        $this->_conn = null;
    }
2995
public function disconnect()
    {
        if (is_resource($this->curl)) {
            curl_close($this->curl);
        }
        $this->curl = null;
    }
350245
def disconnect(self):
        
        self._parser.on_disconnect()
        if self._sock is None:
            return
        try:
            self._sock.shutdown(socket.SHUT_RDWR)
            self._sock.close()
        except socket.error:
            pass
        self._sock = None
266052
private void releaseAllChannelResources() {
		for (int i = 0; i < this.inputGates.size(); i++) {
			this.inputGates.get(i).releaseAllChannelResources();
		}

		for (int i = 0; i < this.outputGates.size(); i++) {
			this.outputGates.get(i).releaseAllChannelResources();
		}
	}