interface StreamInterface (View source)

Methods

bool
open(string $transport, string $host, int $port, int $timeout, array $options = [])

Open the underlying stream.

void
close()

Close the underlying stream.

string|false
read(int $length)

Read data from the stream.

string|false
fgets()

Read a single line from the stream.

int|false
fwrite(string $data)

Write data to the stream.

array
meta()

Return meta info (like stream_get_meta_data).

bool
opened()

Determine if the stream is open.

bool
setTimeout(int $seconds)

Set the timeout on the stream.

bool|int
setSocketSetCrypto(bool $enabled, int|null $method)

Set encryption state on an already connected socked.

Details

bool open(string $transport, string $host, int $port, int $timeout, array $options = [])

Open the underlying stream.

Parameters

string $transport
string $host
int $port
int $timeout
array $options

Return Value

bool

void close()

Close the underlying stream.

Return Value

void

string|false read(int $length)

Read data from the stream.

Parameters

int $length

Return Value

string|false

string|false fgets()

Read a single line from the stream.

Return Value

string|false

int|false fwrite(string $data)

Write data to the stream.

Parameters

string $data

Return Value

int|false

array meta()

Return meta info (like stream_get_meta_data).

Return Value

array

bool opened()

Determine if the stream is open.

Return Value

bool

bool setTimeout(int $seconds)

Set the timeout on the stream.

Parameters

int $seconds

Return Value

bool

bool|int setSocketSetCrypto(bool $enabled, int|null $method)

Set encryption state on an already connected socked.

Parameters

bool $enabled
int|null $method

Return Value

bool|int