SocketIO
extends AbstractIO
in package
Table of Contents
- BUFFER_SIZE = 8192
- $canDispatchPcntlSignal : bool
- $config : null|AMQPConnectionConfig
- $connection_timeout : int|float
- $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|Socket
- __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
- isPcntlSignalEnabled() : bool
- restoreErrorHandler() : void
- select_write() : int|bool
- setErrorHandler() : void
- Begin tracking errors and set the error handler
- throwOnError() : void
- write_heartbeat() : mixed
- Sends a heartbeat message
- isIpv6() : bool
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
$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|Socket
$sock
Methods
__construct()
public
__construct(string $host, int $port[, int|float $read_timeout = 3 ][, bool $keepalive = false ][, int|float|null $write_timeout = null ], int $heartbeat[, null|AMQPConnectionConfig $config = null ]) : mixed
Parameters
- $host : string
- $port : int
- $read_timeout : int|float = 3
- $keepalive : bool = false
- $write_timeout : int|float|null = null
-
if null defaults to read timeout
- $heartbeat : int
-
how often to send heartbeat. 0 means off
- $config : null|AMQPConnectionConfig = null
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
Tags
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 —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
Tags
Return values
void —throwOnError()
protected
throwOnError() : void
Return values
void —write_heartbeat()
Sends a heartbeat message
protected
write_heartbeat() : mixed
Return values
mixed —isIpv6()
private
isIpv6() : bool