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

This is automatic generated document for things in Swow\Stream\EofStream class

Class EofStream

Properties

protected $eof protected $internalBuffer

Methods

Method __construct

public function __construct ( string $eof , int $type )

Method accept

public function accept ( ?int $timeout ) : static

Method getEof

public function getEof ( ) : string

Method recvMessage

public function recvMessage ( Buffer $buffer , ?int $offset , ?int $timeout ) : int

Param ?int $offset default value is $buffer->getLength()

Returns int message length

Method recvMessageFast

public function recvMessageFast ( Buffer $buffer , ?int $offset , ?int $timeout ) : int

It’s faster, but it may consume more memory when message is small. Use it when expect a big package.

Param ?int $offset default value is $buffer->getLength()

Returns int message length

Method recvMessageString

public function recvMessageString ( ?int $timeout ) : string

Method recvMessageStringFast

public function recvMessageStringFast ( ?int $timeout ) : string

Method sendMessage

public function sendMessage ( string|Stringable $message , int $start , int $length , ?int $timeout ) : static

Method sendMessageChunks

public function sendMessageChunks ( non-empty-array<(string | Stringable | Buffer | array{0: (string | Stringable | Buffer), 1?: int, 2?: int} | null)> $chunks , ?int $timeout ) : static

Method sendMessages

public function sendMessages ( non-empty-array<(string | Stringable | Buffer | array{0: (string | Stringable | Buffer), 1?: int, 2?: int} | array<non-empty-array<(string | Stringable | Buffer | array{0: (string | Stringable | Buffer), 1?: int, 2?: int} | null)>> | null)> $messages , ?int $timeout ) : static

Method setEof

public function setEof ( string $eof ) : static

Copyright 2022 the Swow contributors