Skip to main content Link Menu Expand (external link) Document Search Copy Copied

This is automatic generated document for things in Swow\Psr7\Server\ServerConnection class

Class ServerConnection

Constants

public DEFAULT_HTTP_PARSER_EVENTS = null

Properties

protected $server

Methods

Method __construct

public function __construct ( Server $server )

Method close

public function close ( ) : bool

Method error

public function error ( int $statusCode , string $message , ?bool $close ) : void

Method generateResponseHeaders

protected function generateResponseHeaders ( string $body , ?bool $close ) : array<string, string>

Method getMaxContentLength

public function getMaxContentLength ( ) : int

Method getMaxHeaderLength

public function getMaxHeaderLength ( ) : int

Method getServer

public function getServer ( ) : Server

get server bound to this connection

Throws SocketException when connection is shut down

Method offline

protected function offline ( ) : void

Method recvHttpRequest

public function recvHttpRequest ( ?int $timeout ) : (ServerRequestInterface | ServerRequestPlusInterface | ServerRequest)

Method recvServerRequestEntity

public function recvServerRequestEntity ( ?int $timeout ) : ServerRequestEntity

Method respond

public function respond ( (int | string | Stringable | array<string, string> | array<string, array<string>> | bool) ... $args ) : void

Method sendHttpChunk

public function sendHttpChunk ( string|Stringable $chunkData ) : static

Method sendHttpFile

public function sendHttpFile ( ResponseInterface $response , string $filename , int $offset , int $length , ?int $timeout ) : int

Method sendHttpHeader

public function sendHttpHeader ( int $statusCode , string $reasonPhrase , array $headers , string $protocolVersion ) : static

Method sendHttpLastChunk

public function sendHttpLastChunk ( ) : static

Method sendHttpResponse

public function sendHttpResponse ( ResponseInterface $response ) : static

Method upgradeToWebSocket

public function upgradeToWebSocket ( RequestInterface $request , ?ResponseInterface $response ) : static

Copyright 2022 the Swow contributors