| Methods |
public
|
__construct(
ReadableStream $stdin = new ReadableResourceStream(STDIN),
WritableStream $stdout = new WritableResourceStream(STDOUT),
LoggerInterface $logger = new NullLogger(),
int $maxLineBytes = LineReader::DEFAULT_MAX_LINE_BYTES,
)
|
#
|
public
|
start(): void
Begins consuming inbound envelopes from the peer, returning immediately.
Begins consuming inbound envelopes from the peer, returning immediately.
Implements
|
#
|
public
|
send(JsonRpcMessage $message, ?SendContext $context = null): void
Enqueues an outbound JSON-RPC message to the peer, close listeners firing before a write failure is rethrown.
Enqueues an outbound JSON-RPC message to the peer, close listeners firing before a write failure is rethrown.
Implements
|
#
|
public
|
close(): void
Closes the connection once, firing onClose() after the underlying streams close, which an
implementation MUST also do after a fatal error since Server::run() blocks on that signal.
A call from another fiber while a close is in progress MUST block until that close settles,
while one re-entering from the closing fiber returns immediately.
Closes the connection once, firing onClose() after the underlying streams close, which an
implementation MUST also do after a fatal error since Server::run() blocks on that signal.
A call from another fiber while a close is in progress MUST block until that close settles,
while one re-entering from the closing fiber returns immediately.
Implements
|
#
|
public
|
onMessage(Closure $listener): ListenerHandleInterface
A transport multiplexing several peers MUST namespace or rewrite inbound request ids before
emitting them, since the protocol layer correlates and cancels by id alone.
A transport multiplexing several peers MUST namespace or rewrite inbound request ids before
emitting them, since the protocol layer correlates and cancels by id alone.
Implements
|
#
|
public
|
onError(Closure $listener): ListenerHandleInterface
|
#
|
public
|
onDrain(Closure $listener): ListenerHandleInterface
Register a drain listener that fires before close().
Register a drain listener that fires before close().
Implements
|
#
|
public
|
onClose(Closure $listener): ListenerHandleInterface
|
#
|