Disconnect the socket from the current connection.

@return bool Success
554438
public function disconnect()
    {
        if (!is_resource($this->connection)) {
            $this->connected = false;

            return true;
        }
        $this->connected = !fclose($this->connection);

        if (!$this->connected) {
            $this->connection = null;
        }

        return !$this->connected;
    }
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,
             ]
         );
     }
995468
public function disconnect()
	{    	
		$this->exec('echo "EXITING" && exit;');
		
		$this->_conn_link = NULL;
		$this->_connected = FALSE;
		$this->_sftp = NULL;
	}
404967
public function unbind()
    {
        if ($this->isBinded()) {
            $this->getSocket()->unbind($this->dsn);
            $this->dsn = null;
        }

        return $this;
    }
1023307
public function disconnect() {
		if (!is_resource($this->_connection)) {
			$this->connected = false;
		} else {
			$this->connected = !fclose($this->_connection);

			if (!$this->connected) {
				$this->_connection = null;
			}
		}
		return !$this->connected;
	}
1217266
public function disconnect()
    {
        if (!$this->socket) {
            return $this;
        }

        try {
            $this->send('QUIT');
        } catch (\Exception $e) {
            // ignore error - we're closing the socket anyway
        }

        fclose($this->socket);
        $this->socket = null;

        return $this;
    }
2995
public function disconnect()
    {
        if (is_resource($this->curl)) {
            curl_close($this->curl);
        }
        $this->curl = null;
    }
1219083
public function disconnect()
    {
        $parents = $this->parents();
        foreach ($parents->keys() as $object) {
            $path = $parents->get($object);
            unset($object->{$path});
        }
        return $this;
    }
1048321
public function disconnect()
    {
        if ($this->pdo) {
            try {
                $this->getAdapter()->disconnect();
            } catch (Exception $e) {
                $e->log();
            }
        }
    }
603226
public function disconnect()
    {
        if (false === $this->connected) {
            return true;
        }

        if ($this->socket) {
            $this->send(WebsocketPayload::generateClosePayload(), WebsocketPayload::OPCODE_CLOSE);
            $this->closing = true;

            $payloadLength = ord(fread($this->socket, 1));
            $payload = fread($this->socket, $payloadLength);

            if ($this->closing) {
                $this->closing = false;
            } else {
                if ($payloadLength >= 2) {
                    $bin = $payload[0] . $payload[1];
                    $status = bindec(sprintf('%08b%08b', ord($payload[0]), ord($payload[1])));

                    $this->send($bin . 'Close acknowledged: ' . $status, WebsocketPayload::OPCODE_CLOSE);
                }
            }

            fclose($this->socket);
            $this->connected = false;

            return true;
        }

        return false;
    }
488991
public function disconnect()
    {
        if ($this->isConnected()) {
            @stream_socket_shutdown($this->connection, STREAM_SHUT_RDWR);
        }
        $this->connection = null;
        $this->activeHost = [];
    }
651925
def disconnect(self):
        '''
        
        '''
        if not hasattr(self, '_sock'):
            return

        # TODO: If there are bytes left on the output, queue the close for
        # later.
        self._sock.close_cb = None
        self._sock.close()
1135576
public function disconnect(): bool
    {
        $cookieFileName = $this->getCookieFileName();
        if (file_exists($cookieFileName)) {
            return unlink($cookieFileName);
        }

        return false;
    }
217120
private function disconnect()
    {
        if (is_resource($this->_conn)) {
            fclose($this->_conn);
        }
        $this->_auto_reconnect = false;
        $this->_conn = null;
    }
256208
public function close() {

		// Make sure nothing unexpected happens
		try {
		
			// Check that a connection exists first
                	if( isset( $this->socket ) ) {

				// Close the socket
                        	fclose( $this->socket );

				// Unset the socket property
                        	unset($this->socket);

				// The connection is no longer established
				$this->established = false;
                	}

		} catch (Exception $e) {

			throw new MPDConnectionException( 'Disconnection failed: '.$e->getMessage(), self::MPD_DISCONNECTION_FAILED );		
		}

		// We'll assume it was successful
                return true;
        }
482860
public function disconnect()
    {
        if (PEAR::isError($error = $this->put('QUIT'))) {
            return $error;
        }
        if (PEAR::isError($error = $this->parseResponse(221))) {
            return $error;
        }
        if (PEAR::isError($error = $this->socket->disconnect())) {
            return PEAR::raiseError(
                'Failed to disconnect socket: ' . $error->getMessage()
            );
        }

        return true;
    }
1301795
public function disconnect()
    {
        if (!is_array($this->conn) || !count($this->conn)) {
            return;
        }

        foreach ($this->conn as $conn) {
            Connection::close($conn);
        }
    }