Kraken\Network\Websocket\Driver\Version\RFC6455\Connection::close PHP Method

close() public method

public close ( $code = 1000 )
    public function close($code = 1000)
    {
        if ($this->WebSocket->closing) {
            return;
        }
        if ($code instanceof DataInterface) {
            $this->send($code);
        } else {
            $this->send(new Frame(pack('n', $code), true, Frame::OP_CLOSE));
        }
        $this->connection->close();
        $this->WebSocket->closing = true;
    }