Aerys\Websocket\Rfc6455Endpoint::do PHP Method

do() public method

public do ( InternalRequest $ireq )
$ireq InternalRequest
    public function do(InternalRequest $ireq)
    {
        $headers = yield;
        if ($headers[":status"] == 101) {
            $yield = (yield $headers);
        } else {
            return $headers;
            // detach if we don't want to establish websocket connection
        }
        while ($yield !== null) {
            $yield = (yield $yield);
        }
        \Amp\immediately([$this, "reapClient"], ["cb_data" => $ireq]);
    }