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

This is automatic generated document for things in Swow\Http\Protocol\ReceiverTrait class

Trait ReceiverTrait

http response / request receiver

This class is a generic class. Template T of (ServerRequestEntity | ResponseEntity)


protected $autoUnmask protected $buffer protected $bufferLoadFactor protected $httpParser protected $parsedOffset protected $preserveBodyData protected $recvMessageTimeout protected $shouldKeepAlive


Method __constructReceiver

protected function __constructReceiver ( int $type , int $events ) : void

Method getBufferLoadFactor

public function getBufferLoadFactor ( ) : float

Method getRecvMessageTimeout

public function getRecvMessageTimeout ( ) : int

Method isAutoUnmask

public function isAutoUnmask ( ) : bool

Returns bool Whether unmask WebSocket payload data automatically

Method isPreserveBodyData

public function isPreserveBodyData ( ) : bool

Method recvMessageEntity

protected function recvMessageEntity ( ?int $timeout ) : T

Todo The options must be managed in a unified way

Method recvWebSocketFrameEntity

public function recvWebSocketFrameEntity ( ) : WebSocketFrameEntity

This method will unmask masked payloadData and clear the masking key automatically

Method setAutoUnmask

public function setAutoUnmask ( bool $enable ) : static

Param bool $enable If true, WebSocket payload data will be unmasked automatically

Method setBufferLoadFactor

public function setBufferLoadFactor ( float $bufferLoadFactor ) : static

Method setPreserveBodyData

public function setPreserveBodyData ( bool $enable ) : static

Method setRecvMessageTimeout

public function setRecvMessageTimeout ( int $timeout ) : static

Param int $timeout HTTP keep alive timeout in milliseconds

Method shouldKeepAlive

public function shouldKeepAlive ( ) : bool

Method updateParsedOffsetAndRecycleBufferSpace

protected function updateParsedOffsetAndRecycleBufferSpace ( Buffer $buffer , int $parsedOffset ) : void

Copyright 2022 the Swow contributors