src/Client.php
public function disconnect($sync = false)
    {
        try {
            if ($this->connection && $this->connection->isConnected()) {
                if ($this->protocol) {
                    $this->sendFrame($this->protocol->getDisconnectFrame(), $sync);
                }
            }
        } catch (StompException $ex) {
            // nothing!
        }
        if ($this->connection) {
            $this->connection->disconnect();
        }

        $this->sessionId = null;
        $this->unprocessedFrames = [];
        $this->protocol = null;
        $this->isConnecting = false;
    }
public function disconnect($sync = false)
    {
        try {
            if ($this->connection && $this->connection->isConnected()) {
                if ($this->protocol) {
                    $this->sendFrame($this->protocol->getDisconnectFrame(), $sync);
                }
            }
        } catch (StompException $ex) {
            // nothing!
        }
        if ($this->connection) {
            $this->connection->disconnect();
        }

        $this->sessionId = null;
        $this->unprocessedFrames = [];
        $this->protocol = null;
        $this->isConnecting = false;
    }
public function disconnect ( $ sync = false ) { try { if ( $ this -> connection && $ this -> connection -> isConnected ( ) ) { if ( $ this -> protocol ) { $ this -> sendFrame ( $ this -> protocol -> getDisconnectFrame ( ) , $ sync ) ; } } } catch ( StompException $ ex ) { // nothing! } if ( $ this -> connection ) { $ this -> connection -> disconnect ( ) ; } $ this -> sessionId = null ; $ this -> unprocessedFrames = [ ] ; $ this -> protocol = null ; $ this -> isConnecting = false ; }
Graceful disconnect from the server
@param bool $sync
@return void
Graceful disconnect from the server