PHP 클래스 Network\Socket

Event driven I/O.
상속: extends XPSPL\SIG_Routine
파일 보기 프로젝트 열기: prggmr/xpspl

공개 프로퍼티들

프로퍼티 타입 설명
$default_wait_time integer Default socket wait time in seconds.

보호된 프로퍼티들

프로퍼티 타입 설명
$_address string Socket Address
$_clients array Client sockets currently connected for read/write.
$_connection object Socket connection object
$_options Options used for the socket.

공개 메소드들

메소드 설명
__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 ( Routine $routine ) : void Registers the idle process.

보호된 메소드들

메소드 설명
_connect ( ) : void Establishes the socket connection.

메소드 상세

__construct() 공개 메소드

Constructs a new socket.
public __construct ( string $address, string $options = [] ) : void
$address string Address to make the connection on.
$options string Connection options
리턴 void

_connect() 보호된 메소드

Establishes the socket connection.
protected _connect ( ) : void
리턴 void

get_connections() 공개 메소드

Returns the currently connected clients.
public get_connections ( ) : array
리턴 array

on_connect() 공개 메소드

Registers a new handle for new client connections.
public on_connect ( callable $function ) : object
$function callable Function to call on connect.
리턴 object

on_disconnect() 공개 메소드

Registers a new handle for disconnections.
public on_disconnect ( callable $function ) : object
$function callable Function to call on connect.
리턴 object

on_error() 공개 메소드

Registers a new handle for socket connection errors.
public on_error ( callable $function ) : object
$function callable Function to call on errors.
리턴 object

on_read() 공개 메소드

Registers a new handle for client read.
public on_read ( callable $function ) : object
$function callable Function to call on connect.
리턴 object

on_write() 공개 메소드

Registers a new handle for client write.
public on_write ( callable $function ) : object
$function callable Function to call on connect.
리턴 object

reconnect() 공개 메소드

It will attempt to close before reconnecting.
public reconnect ( ) : void
리턴 void

routine() 공개 메소드

Registers the idle process.
public routine ( Routine $routine ) : void
$routine XPSPL\Routine
리턴 void

프로퍼티 상세

$_address 보호되어 있는 프로퍼티

Socket Address
protected string $_address
리턴 string

$_clients 보호되어 있는 프로퍼티

Client sockets currently connected for read/write.
protected array $_clients
리턴 array

$_connection 보호되어 있는 프로퍼티

Socket connection object
protected object $_connection
리턴 object

$_options 보호되어 있는 프로퍼티

Options used for the socket.
protected $_options

$default_wait_time 공개적으로 프로퍼티

Default socket wait time in seconds.
public int $default_wait_time
리턴 integer