Property | Type | Description | |
---|---|---|---|
$default_wait_time | integer | Default socket wait time in seconds. |
Property | Type | Description | |
---|---|---|---|
$_address | string | Socket Address | |
$_clients | array | Client sockets currently connected for read/write. | |
$_connection | object | Socket connection object | |
$_options | Options used for the socket. |
Method | Description | |
---|---|---|
__construct ( string $address, string $options = [] ) : void | Constructs a new socket. | |
get_connections ( ) : array | Returns the currently connected clients. | |
on_connect ( callable $function ) : object | Registers a new handle for new client connections. | |
on_disconnect ( callable $function ) : object | Registers a new handle for disconnections. | |
on_error ( callable $function ) : object | Registers a new handle for socket connection errors. | |
on_read ( callable $function ) : object | Registers a new handle for client read. | |
on_write ( callable $function ) : object | Registers a new handle for client write. | |
reconnect ( ) : void | Reconnects the socket. | |
routine ( |
Registers the idle process. |
Method | Description | |
---|---|---|
_connect ( ) : void | Establishes the socket connection. |
public get_connections ( ) : array | ||
return | array |
public on_connect ( callable $function ) : object | ||
$function | callable | Function to call on connect. |
return | object |
public on_disconnect ( callable $function ) : object | ||
$function | callable | Function to call on connect. |
return | object |
protected array $_clients | ||
return | array |
protected object $_connection | ||
return | object |
public int $default_wait_time | ||
return | integer |