| Methods |
public
|
start(): void
Begins consuming inbound envelopes from the peer. Returns immediately.
Begins consuming inbound envelopes from the peer. Returns immediately.
Throws
Implemented by
|
#
|
public
|
send(JsonRpcMessage $message, ?SendContext $context = null): void
Enqueues an outbound JSON-RPC message to the peer. On write failure, close listeners fire before the exception is rethrown.
Enqueues an outbound JSON-RPC message to the peer. On write failure, close listeners fire before the exception is rethrown.
Throws
Implemented by
|
#
|
public
|
close(): void
Closes the connection. The onClose() listener fires once after the
underlying streams are closed. Subsequent calls are no-ops. Implementations MUST guarantee that onClose() listeners fire after a
fatal error too, not only after explicit close(). Server::run()
blocks on the close signal, so a transport that raises errors without
eventually closing would hang the server loop.
Closes the connection. The onClose() listener fires once after the
underlying streams are closed. Subsequent calls are no-ops. Implementations MUST guarantee that onClose() listeners fire after a
fatal error too, not only after explicit close(). Server::run()
blocks on the close signal, so a transport that raises errors without
eventually closing would hang the server loop.
Implemented by
|
#
|
public
|
getSessionId(): ?string
Returns the transport-issued session identifier, or null when the
transport carries no session (e.g. stdio).
Returns the transport-issued session identifier, or null when the
transport carries no session (e.g. stdio).
Implemented by
|
#
|
public
|
onMessage(Closure(array<string, mixed>): void $listener): SubscriptionInterface
Register an inbound-envelope listener.
Register an inbound-envelope listener.
Implemented by
|
#
|
public
|
onError(Closure(Throwable): void $listener): SubscriptionInterface
Register an error listener.
Register an error listener.
Implemented by
|
#
|
public
|
onDrain(Closure(): void $listener): SubscriptionInterface
Register a drain listener that fires before close().
Register a drain listener that fires before close().
Implemented by
|
#
|
public
|
onClose(Closure(): void $listener): SubscriptionInterface
Register a close listener.
Register a close listener.
Implemented by
|
#
|