Aerys\Websocket\Rfc6455Endpoint::doClose PHP Method

doClose() private method

private doClose ( Aerys\Websocket\Rfc6455Client $client, integer $code, string $reason ) : Generator
$client Aerys\Websocket\Rfc6455Client
$code integer
$reason string
return Generator
    private function doClose(Rfc6455Client $client, int $code, string $reason) : \Generator
    {
        // Only proceed if we haven't already begun the close handshake elsewhere
        if ($client->closedAt) {
            return;
        }
        $this->closeTimeouts[$client->id] = $this->now + $this->closePeriod;
        $promise = $this->sendCloseFrame($client, $code, $reason);
        yield from $this->tryAppOnClose($client->id, $code, $reason);
        return $promise;
        // Don't unload the client here, it will be unloaded upon timeout
    }