PHP 클래스 Aerys\Server

상속: implements SplSubject, use trait Struct
파일 보기 프로젝트 열기: amphp/aerys 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Options $options, VhostContainer $vhosts, Psr\Log\LoggerInterface $logger, Ticker $ticker )
__debugInfo ( )
attach ( aerys\ServerObserver $observer ) : void Attach an observer
detach ( aerys\ServerObserver $observer ) : void Detach an Observer
getOption ( string $option ) Retrieve a server option value
monitor ( ) : array
setOption ( string $option, mixed $newValue ) : void Assign a server option value
start ( ) : Promise Start the server
state ( ) : integer Retrieve the current server state
stop ( ) : Promise Stop the server

비공개 메소드들

메소드 설명
bind ( string $address, $context )
clear ( Client $client )
clearKeepAliveTimeout ( Client $client )
close ( Client $client )
doStart ( ) : Generator
doStop ( ) : Generator
dropPrivileges ( )
export ( Client $client ) : Closure
failCryptoNegotiation ( $socket, $ip )
generateBindableAddressContextMap ( )
importClient ( $socket, $ip, $port )
initializeRequest ( Client $client, array $parseResult ) : InternalRequest
initializeResponse ( InternalRequest $ireq, array $filters ) : aerys\Response
logDebug ( $message ) This function MUST always return TRUE. It should only be invoked inside an assert() block so that we can cancel its opcodes when in production mode. This approach allows us to take full advantage of debug mode log output without adding superfluous method call overhead in production environments.
makePrivateCallable ( string $method ) : Closure We frequently have to pass callables to outside code (like amp).
negotiateCrypto ( string $watcherId, $socket, $peer )
notify ( ) : Promise Notify observers of a server state change
onAcceptable ( string $watcherId, $server )
onApplicationError ( Throwable $error, InternalRequest $ireq, aerys\Response $response, array $filters )
onCoroutineAppResolve ( $error, $result, $info )
onEntitySizeWarning ( Client $client, array $parseResult )
onParseEmit ( Client $client, $eventType, $parseResult, $errorStruct = null )
onParseError ( Client $client, array $parseResult, string $error )
onParsedEntityHeaders ( Client $client, array $parseResult )
onParsedEntityPart ( Client $client, array $parseResult )
onParsedMessageWithEntity ( Client $client, array $parseResult )
onParsedMessageWithoutEntity ( Client $client, array $parseResult )
onReadable ( string $watcherId, $socket, $client )
onResponseDataDone ( Client $client )
onWritable ( string $watcherId, $socket, $client )
renewKeepAliveTimeout ( Client $client )
respond ( InternalRequest $ireq )
sendPreAppInvalidHostResponse ( aerys\Request $request, aerys\Response $response )
sendPreAppMethodNotAllowedResponse ( aerys\Request $request, aerys\Response $response )
sendPreAppOptionsResponse ( aerys\Request $request, aerys\Response $response )
sendPreAppServiceUnavailableResponse ( aerys\Request $request, aerys\Response $response )
sendPreAppTraceResponse ( aerys\Request $request, aerys\Response $response )
setTrace ( InternalRequest $ireq )
timeoutKeepAlives ( integer $now )
tryApplication ( InternalRequest $ireq, callable $application, array $filters )
tryErrorResponse ( Throwable $error, InternalRequest $ireq, aerys\Response $response, array $filters )
tryFilterErrorResponse ( Throwable $error, InternalRequest $ireq, array $filters ) When an uncaught exception is thrown by a filter we enable the $ireq->filterErrorFlag and add the offending filter's key to $ireq->badFilterKeys. Each time we initialize a response the bad filters are removed from the chain in an effort to invoke all possible filters. To handle the scenario where multiple filters error we need to continue looping until $ireq->filterErrorFlag no longer reports as true.
writeResponse ( Client $client, $final = false )

메소드 상세

__construct() 공개 메소드

public __construct ( Options $options, VhostContainer $vhosts, Psr\Log\LoggerInterface $logger, Ticker $ticker )
$options Options
$vhosts VhostContainer
$logger Psr\Log\LoggerInterface
$ticker Ticker

__debugInfo() 공개 메소드

public __debugInfo ( )

attach() 공개 메소드

Attach an observer
public attach ( aerys\ServerObserver $observer ) : void
$observer aerys\ServerObserver
리턴 void

detach() 공개 메소드

Detach an Observer
public detach ( aerys\ServerObserver $observer ) : void
$observer aerys\ServerObserver
리턴 void

getOption() 공개 메소드

Retrieve a server option value
public getOption ( string $option )
$option string The option to retrieve

monitor() 공개 메소드

public monitor ( ) : array
리턴 array

setOption() 공개 메소드

Assign a server option value
public setOption ( string $option, mixed $newValue ) : void
$option string The option to retrieve
$newValue mixed
리턴 void

start() 공개 메소드

Start the server
public start ( ) : Promise
리턴 Promise

state() 공개 메소드

Retrieve the current server state
public state ( ) : integer
리턴 integer

stop() 공개 메소드

Stop the server
public stop ( ) : Promise
리턴 Promise