StreamIO
extends AbstractIO
in package
Table of Contents
- BUFFER_SIZE = 8192
- $canDispatchPcntlSignal : bool
- $config : null|AMQPConnectionConfig
- $connection_timeout : int|float
- $context : null|resource
- $heartbeat : int
- $host : string
- $initial_heartbeat : int
- $keepalive : bool
- $last_error : ErrorException|null
- $last_read : int|float
- $last_write : int|float
- $port : int
- $read_timeout : float
- $write_timeout : float
- $sock : null|resource
- __construct() : mixed
- afterTune() : void
- Set connection params connection tune(negotiation).
- check_heartbeat() : void
- Heartbeat logic: check connection health here
- close() : void
- connect() : void
- Set ups the connection.
- disableHeartbeat() : $this
- error_handler() : void
- Internal error handler to deal with stream and socket errors.
- getLastActivity() : float|int
- getReadTimeout() : float
- getSocket() : null|resource|Socket
- read() : string
- reenableHeartbeat() : $this
- select() : int
- write() : mixed
- checkBrokerHeartbeat() : void
- do_select() : int|bool
- enable_keepalive() : void
- extract_error_code() : int
- isPcntlSignalEnabled() : bool
- restoreErrorHandler() : void
- select_write() : int|bool
- setErrorHandler() : void
- Begin tracking errors and set the error handler
- throwOnError() : void
- timed_out() : mixed
- write_heartbeat() : mixed
- Sends a heartbeat message
- enableCrypto() : void
- setupContext() : resource
Constants
BUFFER_SIZE
public
mixed
BUFFER_SIZE
= 8192
Properties
$canDispatchPcntlSignal
protected
bool
$canDispatchPcntlSignal
= false
$config
protected
null|AMQPConnectionConfig
$config
$connection_timeout
protected
int|float
$connection_timeout
$context
protected
null|resource
$context
$heartbeat
protected
int
$heartbeat
$host
protected
string
$host
$initial_heartbeat
protected
int
$initial_heartbeat
$keepalive
protected
bool
$keepalive
$last_error
protected
ErrorException|null
$last_error
$last_read
protected
int|float
$last_read
$last_write
protected
int|float
$last_write
$port
protected
int
$port
$read_timeout
protected
float
$read_timeout
$write_timeout
protected
float
$write_timeout
$sock
private
null|resource
$sock
Methods
__construct()
public
__construct(string $host, int $port, float $connection_timeout, float $read_write_timeout[, resource|null $context = null ][, bool $keepalive = false ], int $heartbeat[, string|null $ssl_protocol = null ]) : mixed
Parameters
- $host : string
- $port : int
- $connection_timeout : float
- $read_write_timeout : float
- $context : resource|null = null
- $keepalive : bool = false
- $heartbeat : int
- $ssl_protocol : string|null = null
-
@deprecated
Return values
mixed —afterTune()
Set connection params connection tune(negotiation).
public
afterTune(int $heartbeat) : void
Parameters
- $heartbeat : int
Return values
void —check_heartbeat()
Heartbeat logic: check connection health here
public
check_heartbeat() : void
Tags
Return values
void —close()
public
close() : void
Return values
void —connect()
Set ups the connection.
public
connect() : void
Tags
Return values
void —disableHeartbeat()
public
disableHeartbeat() : $this
Return values
$this —error_handler()
Internal error handler to deal with stream and socket errors.
public
error_handler(mixed $errno, mixed $errstr, mixed $errfile, mixed $errline) : void
Parameters
- $errno : mixed
- $errstr : mixed
- $errfile : mixed
- $errline : mixed
Tags
Return values
void —getLastActivity()
public
getLastActivity() : float|int
Return values
float|int —getReadTimeout()
public
getReadTimeout() : float
Return values
float —getSocket()
public
getSocket() : null|resource|Socket
Tags
Return values
null|resource|Socket —read()
public
read(mixed $len) : string
Parameters
- $len : mixed
Tags
Return values
string —reenableHeartbeat()
public
reenableHeartbeat() : $this
Return values
$this —select()
public
select(int|null $sec, int $usec) : int
Parameters
- $sec : int|null
- $usec : int
Tags
Return values
int —write()
public
write(mixed $data) : mixed
Parameters
- $data : mixed
Tags
Return values
mixed —checkBrokerHeartbeat()
protected
checkBrokerHeartbeat() : void
Tags
Return values
void —do_select()
protected
do_select(int|null $sec, int $usec) : int|bool
Parameters
- $sec : int|null
- $usec : int
Tags
Return values
int|bool —enable_keepalive()
protected
enable_keepalive() : void
Tags
Return values
void —extract_error_code()
protected
extract_error_code(string $message) : int
Parameters
- $message : string
Return values
int —isPcntlSignalEnabled()
protected
isPcntlSignalEnabled() : bool
Return values
bool —restoreErrorHandler()
protected
restoreErrorHandler() : void
Return values
void —select_write()
protected
select_write() : int|bool
Return values
int|bool —setErrorHandler()
Begin tracking errors and set the error handler
protected
setErrorHandler() : void
Return values
void —throwOnError()
protected
throwOnError() : void
Return values
void —timed_out()
protected
timed_out() : mixed
Return values
mixed —write_heartbeat()
Sends a heartbeat message
protected
write_heartbeat() : mixed
Return values
mixed —enableCrypto()
private
enableCrypto() : void
Tags
Return values
void —setupContext()
private
setupContext() : resource