LocalIpcHub
in package
implements
IpcHub
uses
ForbidCloning, ForbidSerialization
FinalYes
Table of Contents
Interfaces
Properties
- $delegate : SocketIpcHub
- $toUnlink : string|null
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
- unlink() : void
Properties
$delegate read-only
private
SocketIpcHub
$delegate
$toUnlink
private
string|null
$toUnlink
= null
Methods
__construct()
public
__construct([float $keyReceiveTimeout = SocketIpcHub::DEFAULT_KEY_RECEIVE_TIMEOUT ][, positive-int $keyLength = SocketIpcHub::DEFAULT_KEY_LENGTH ]) : mixed
Parameters
- $keyReceiveTimeout : float = SocketIpcHub::DEFAULT_KEY_RECEIVE_TIMEOUT
-
Timeout to receive the key on accepted connections.
- $keyLength : positive-int = SocketIpcHub::DEFAULT_KEY_LENGTH
-
Length of the random key exchanged on the IPC channel when connecting.
Tags
__destruct()
public
__destruct() : mixed
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
neveraccept()
public
accept(string $key[, Cancellation|null $cancellation = null ]) : ResourceSocket
Parameters
- $key : string
-
A key generated by generateKey().
- $cancellation : Cancellation|null = null
Return values
ResourceSocketclose()
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
__clone()
protected
final __clone() : mixed
unlink()
private
unlink() : void