private function export(callable $upgrade, string $buffer)
    {
        if ($this->status & self::CLOSED_RDWR || $this->isExported) {
            return;
        }

        $this->clear();
        $this->isExported = true;

        \assert($this->logger->debug("Upgrade {$this->clientAddress}:{$this->clientPort} #{$this->id}") || true);

        try {
            $upgrade(new Internal\DetachedSocket($this, $this->socket, $buffer, $this->options->getChunkSize()));
        } catch (\Throwable $exception) {
            $this->logger->error($exception);
            $this->close();
        }
    }
private function export(callable $upgrade, string $buffer)
    {
        if ($this->status & self::CLOSED_RDWR || $this->isExported) {
            return;
        }

        $this->clear();
        $this->isExported = true;

        \assert($this->logger->debug("Upgrade {$this->clientAddress}:{$this->clientPort} #{$this->id}") || true);

        try {
            $upgrade(new Internal\DetachedSocket($this, $this->socket, $buffer, $this->options->getChunkSize()));
        } catch (\Throwable $exception) {
            $this->logger->error($exception);
            $this->close();
        }
    }
private function export ( callable $ upgrade , string $ buffer ) { if ( $ this -> status & self :: CLOSED_RDWR || $ this -> isExported ) { return ; } $ this -> clear ( ) ; $ this -> isExported = true ; \ assert ( $ this -> logger -> debug ( "Upgrade {$this->clientAddress}:{$this->clientPort} #{$this->id}" ) || true ) ; try { $ upgrade ( new Internal \ DetachedSocket ( $ this , $ this -> socket , $ buffer , $ this -> options -> getChunkSize ( ) ) ) ; } catch ( \ Throwable $ exception ) { $ this -> logger -> error ( $ exception ) ; $ this -> close ( ) ; } }
Invokes the export function on Response with the socket detached from the HTTP server.

@param callable $upgrade callable
@param string $buffer Remaining buffer read from the socket.
Invokes the export function on Response with the socket detached from the HTTP server .