Documentation

SocketIpcHub
in package
implements IpcHub uses ForbidCloning, ForbidSerialization

FinalYes

Table of Contents

Interfaces

IpcHub

Constants

DEFAULT_KEY_LENGTH  = 64
DEFAULT_KEY_RECEIVE_TIMEOUT  = 5

Properties

$accept  : callable(): void
$clientsByKey  : LocalCache<string|int, ResourceSocket>
$keyLength  : int
$queued  : bool
$server  : ServerSocket
$uri  : non-empty-string
$waitingByKey  : array<string, DeferredFuture>

Methods

__construct()  : mixed
__destruct()  : mixed
__serialize()  : never
__unserialize()  : never
accept()  : ResourceSocket
close()  : void
Closes the resource, marking it as unusable.
generateKey()  : non-empty-string
getUri()  : non-empty-string
isClosed()  : bool
Returns whether this resource has been closed.
onClose()  : void
Registers a callback that is invoked when this resource is closed.
__clone()  : mixed

Constants

DEFAULT_KEY_RECEIVE_TIMEOUT

public mixed DEFAULT_KEY_RECEIVE_TIMEOUT = 5

Properties

$keyLength read-only

private int $keyLength = self::DEFAULT_KEY_LENGTH

Methods

__construct()

public __construct(ServerSocket $server[, float $keyReceiveTimeout = self::DEFAULT_KEY_RECEIVE_TIMEOUT ][, positive-int $keyLength = self::DEFAULT_KEY_LENGTH ]) : mixed
Parameters
$server : ServerSocket
$keyReceiveTimeout : float = self::DEFAULT_KEY_RECEIVE_TIMEOUT

Timeout to receive the key on accepted connections.

$keyLength : positive-int = self::DEFAULT_KEY_LENGTH

Length of the random key exchanged on the IPC channel when connecting.

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : never
Parameters
$data : array<string|int, mixed>
Return values
never

close()

Closes the resource, marking it as unusable.

public close() : void

Whether pending operations are aborted or not is implementation dependent.

generateKey()

public generateKey() : non-empty-string
Return values
non-empty-string

Pass the key returned from this method to the connecting context and accept().

getUri()

public getUri() : non-empty-string
Return values
non-empty-string

URI to use with connect().

isClosed()

Returns whether this resource has been closed.

public isClosed() : bool
Return values
bool

true if closed, otherwise false.

onClose()

Registers a callback that is invoked when this resource is closed.

public onClose(Closure $onClose) : void
Parameters
$onClose : Closure

        
On this page

Search results