Class RpcPeer
Namespace: DotBoxD.Services.Peer
Assembly: DotBoxD.Services.dll
One symmetric side of a DotBoxD connection. A peer can provide local services and get proxies for remote services over one demuxed read loop.
public sealed class RpcPeer : IAsyncDisposable, IRpcInvokerInheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.Equals(object), object.Equals(object, object), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object, object), object.ToString()
Properties
Section titled “Properties”IsConnected
Section titled “ IsConnected”Gets whether the underlying channel is still connected.
public bool IsConnected { get; }Property Value
Section titled “Property Value”RemoteEndpoint
Section titled “ RemoteEndpoint”The remote endpoint string of the underlying channel.
public string RemoteEndpoint { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”CloseAsync(CancellationToken)
Section titled “ CloseAsync(CancellationToken)”Closes the peer by disposing it; closed peers cannot be restarted.
public Task CloseAsync(CancellationToken ct = default)Parameters
Section titled “Parameters”Returns
Section titled “Returns”Remarks
Section titled “Remarks”Disposal always runs to completion: ct fails fast only before any teardown
begins, and never abandons an in-progress dispose to finish in the background.
DisposeAsync()
Section titled “ DisposeAsync()”Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()Returns
Section titled “Returns”A task that represents the asynchronous dispose operation.
Get<TService>()
Section titled “ Get<TService>()”Creates a proxy to call TService on the other side.
public TService Get<TService>() where TService : classReturns
Section titled “Returns”TService
Type Parameters
Section titled “Type Parameters”TService
InvokeAsync<TRequest, TResponse>(string, string, TRequest, CancellationToken)
Section titled “ InvokeAsync<TRequest, TResponse>(string, string, TRequest, CancellationToken)”Invokes a method with a request body and a response body.
public Task<TResponse> InvokeAsync<TRequest, TResponse>(string service, string method, TRequest request, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
The remote service name.
method string
The method to invoke.
request TRequest
The request payload.
Cancellation token.
Returns
Section titled “Returns”Task<TResponse>
Type Parameters
Section titled “Type Parameters”TRequest
TResponse
InvokeAsync<TRequest, TResponse>(string, string, TRequest, RpcStreamAttachment[], CancellationToken)
Section titled “ InvokeAsync<TRequest, TResponse>(string, string, TRequest, RpcStreamAttachment[], CancellationToken)”Invokes a method with a request body that references streamed arguments.
public Task<TResponse> InvokeAsync<TRequest, TResponse>(string service, string method, TRequest request, RpcStreamAttachment[] streams, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
streams RpcStreamAttachment[]
Returns
Section titled “Returns”Task<TResponse>
Type Parameters
Section titled “Type Parameters”TRequest
TResponse
InvokeAsync<TResponse>(string, string, CancellationToken)
Section titled “ InvokeAsync<TResponse>(string, string, CancellationToken)”Invokes a method with no request body and a response body.
public Task<TResponse> InvokeAsync<TResponse>(string service, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
The remote service name.
method string
The method to invoke.
Cancellation token.
Returns
Section titled “Returns”Task<TResponse>
Type Parameters
Section titled “Type Parameters”TResponse
InvokeAsync<TRequest>(string, string, TRequest, CancellationToken)
Section titled “ InvokeAsync<TRequest>(string, string, TRequest, CancellationToken)”Invokes a method with a request body and no response body.
public Task InvokeAsync<TRequest>(string service, string method, TRequest request, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
The remote service name.
method string
The method to invoke.
request TRequest
The request payload.
Cancellation token.
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeAsync<TRequest>(string, string, TRequest, RpcStreamAttachment[], CancellationToken)
Section titled “ InvokeAsync<TRequest>(string, string, TRequest, RpcStreamAttachment[], CancellationToken)”Invokes a no-response method with a request body that references streamed arguments.
public Task InvokeAsync<TRequest>(string service, string method, TRequest request, RpcStreamAttachment[] streams, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
streams RpcStreamAttachment[]
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeAsync(string, string, CancellationToken)
Section titled “ InvokeAsync(string, string, CancellationToken)”Invokes a method with neither a request nor a response body.
public Task InvokeAsync(string service, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
The remote service name.
method string
The method to invoke.
Cancellation token.
Returns
Section titled “Returns”InvokeAsync<TRequest, TResponse>(string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeAsync<TRequest, TResponse>(string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task<TResponse> InvokeAsync<TRequest, TResponse>(string service, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Task<TResponse>
Type Parameters
Section titled “Type Parameters”TRequest
TResponse
InvokeAsync<TRequest>(string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeAsync<TRequest>(string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task InvokeAsync<TRequest>(string service, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeAsyncEnumerable<T>(string, string, CancellationToken)
Section titled “ InvokeAsyncEnumerable<T>(string, string, CancellationToken)”public IAsyncEnumerable<T> InvokeAsyncEnumerable<T>(string service, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”T
InvokeAsyncEnumerable<TRequest, T>(string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)
Section titled “ InvokeAsyncEnumerable<TRequest, T>(string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)”public IAsyncEnumerable<T> InvokeAsyncEnumerable<TRequest, T>(string service, string method, TRequest request, RpcStreamAttachment[]? streams = null, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
streams RpcStreamAttachment[]?
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
T
InvokeAsyncEnumerable<TRequest, T>(string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeAsyncEnumerable<TRequest, T>(string, string, TRequest, RpcStreamAttachment, CancellationToken)”public IAsyncEnumerable<T> InvokeAsyncEnumerable<TRequest, T>(string service, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
T
InvokeAsyncEnumerableAsync<T>(string, string, CancellationToken)
Section titled “ InvokeAsyncEnumerableAsync<T>(string, string, CancellationToken)”public Task<IAsyncEnumerable<T>> InvokeAsyncEnumerableAsync<T>(string service, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
Returns
Section titled “Returns”Task<IAsyncEnumerable<T>>
Type Parameters
Section titled “Type Parameters”T
InvokeAsyncEnumerableAsync<TRequest, T>(string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)
Section titled “ InvokeAsyncEnumerableAsync<TRequest, T>(string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)”public Task<IAsyncEnumerable<T>> InvokeAsyncEnumerableAsync<TRequest, T>(string service, string method, TRequest request, RpcStreamAttachment[]? streams = null, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
streams RpcStreamAttachment[]?
Returns
Section titled “Returns”Task<IAsyncEnumerable<T>>
Type Parameters
Section titled “Type Parameters”TRequest
T
InvokeAsyncEnumerableAsync<TRequest, T>(string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeAsyncEnumerableAsync<TRequest, T>(string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task<IAsyncEnumerable<T>> InvokeAsyncEnumerableAsync<TRequest, T>(string service, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Task<IAsyncEnumerable<T>>
Type Parameters
Section titled “Type Parameters”TRequest
T
InvokeAsyncEnumerableOnInstance<T>(string, string, string, CancellationToken)
Section titled “ InvokeAsyncEnumerableOnInstance<T>(string, string, string, CancellationToken)”public IAsyncEnumerable<T> InvokeAsyncEnumerableOnInstance<T>(string service, string instanceId, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”T
InvokeAsyncEnumerableOnInstance<TRequest, T>(string, string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)
Section titled “ InvokeAsyncEnumerableOnInstance<TRequest, T>(string, string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)”public IAsyncEnumerable<T> InvokeAsyncEnumerableOnInstance<TRequest, T>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment[]? streams = null, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
streams RpcStreamAttachment[]?
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
T
InvokeAsyncEnumerableOnInstance<TRequest, T>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeAsyncEnumerableOnInstance<TRequest, T>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)”public IAsyncEnumerable<T> InvokeAsyncEnumerableOnInstance<TRequest, T>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
T
InvokeAsyncEnumerableOnInstanceAsync<T>(string, string, string, CancellationToken)
Section titled “ InvokeAsyncEnumerableOnInstanceAsync<T>(string, string, string, CancellationToken)”public Task<IAsyncEnumerable<T>> InvokeAsyncEnumerableOnInstanceAsync<T>(string service, string instanceId, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
Returns
Section titled “Returns”Task<IAsyncEnumerable<T>>
Type Parameters
Section titled “Type Parameters”T
InvokeAsyncEnumerableOnInstanceAsync<TRequest, T>(string, string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)
Section titled “ InvokeAsyncEnumerableOnInstanceAsync<TRequest, T>(string, string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)”public Task<IAsyncEnumerable<T>> InvokeAsyncEnumerableOnInstanceAsync<TRequest, T>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment[]? streams = null, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
streams RpcStreamAttachment[]?
Returns
Section titled “Returns”Task<IAsyncEnumerable<T>>
Type Parameters
Section titled “Type Parameters”TRequest
T
InvokeAsyncEnumerableOnInstanceAsync<TRequest, T>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeAsyncEnumerableOnInstanceAsync<TRequest, T>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task<IAsyncEnumerable<T>> InvokeAsyncEnumerableOnInstanceAsync<TRequest, T>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Task<IAsyncEnumerable<T>>
Type Parameters
Section titled “Type Parameters”TRequest
T
InvokeOnInstanceAsync<TRequest, TResponse>(string, string, string, TRequest, CancellationToken)
Section titled “ InvokeOnInstanceAsync<TRequest, TResponse>(string, string, string, TRequest, CancellationToken)”Invokes a method on a specific remote sub-service instance.
public Task<TResponse> InvokeOnInstanceAsync<TRequest, TResponse>(string service, string instanceId, string method, TRequest request, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
The remote service name.
instanceId string
The target instance identifier.
method string
The method to invoke.
request TRequest
The request payload.
Cancellation token.
Returns
Section titled “Returns”Task<TResponse>
Type Parameters
Section titled “Type Parameters”TRequest
TResponse
InvokeOnInstanceAsync<TRequest, TResponse>(string, string, string, TRequest, RpcStreamAttachment[], CancellationToken)
Section titled “ InvokeOnInstanceAsync<TRequest, TResponse>(string, string, string, TRequest, RpcStreamAttachment[], CancellationToken)”public Task<TResponse> InvokeOnInstanceAsync<TRequest, TResponse>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment[] streams, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
streams RpcStreamAttachment[]
Returns
Section titled “Returns”Task<TResponse>
Type Parameters
Section titled “Type Parameters”TRequest
TResponse
InvokeOnInstanceAsync<TResponse>(string, string, string, CancellationToken)
Section titled “ InvokeOnInstanceAsync<TResponse>(string, string, string, CancellationToken)”Invokes an instance-scoped method with no request body and a response body.
public Task<TResponse> InvokeOnInstanceAsync<TResponse>(string service, string instanceId, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
The remote service name.
instanceId string
The target instance identifier.
method string
The method to invoke.
Cancellation token.
Returns
Section titled “Returns”Task<TResponse>
Type Parameters
Section titled “Type Parameters”TResponse
InvokeOnInstanceAsync<TRequest>(string, string, string, TRequest, CancellationToken)
Section titled “ InvokeOnInstanceAsync<TRequest>(string, string, string, TRequest, CancellationToken)”Invokes an instance-scoped method with a request body and no response body.
public Task InvokeOnInstanceAsync<TRequest>(string service, string instanceId, string method, TRequest request, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
The remote service name.
instanceId string
The target instance identifier.
method string
The method to invoke.
request TRequest
The request payload.
Cancellation token.
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment[], CancellationToken)
Section titled “ InvokeOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment[], CancellationToken)”public Task InvokeOnInstanceAsync<TRequest>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment[] streams, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
streams RpcStreamAttachment[]
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeOnInstanceAsync(string, string, string, CancellationToken)
Section titled “ InvokeOnInstanceAsync(string, string, string, CancellationToken)”Invokes an instance-scoped method with neither a request nor a response body.
public Task InvokeOnInstanceAsync(string service, string instanceId, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
The remote service name.
instanceId string
The target instance identifier.
method string
The method to invoke.
Cancellation token.
Returns
Section titled “Returns”InvokeOnInstanceAsync<TRequest, TResponse>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeOnInstanceAsync<TRequest, TResponse>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task<TResponse> InvokeOnInstanceAsync<TRequest, TResponse>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Task<TResponse>
Type Parameters
Section titled “Type Parameters”TRequest
TResponse
InvokeOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task InvokeOnInstanceAsync<TRequest>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokePipeAsync(string, string, CancellationToken)
Section titled “ InvokePipeAsync(string, string, CancellationToken)”public Task<Pipe> InvokePipeAsync(string service, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
Returns
Section titled “Returns”InvokePipeAsync<TRequest>(string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)
Section titled “ InvokePipeAsync<TRequest>(string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)”public Task<Pipe> InvokePipeAsync<TRequest>(string service, string method, TRequest request, RpcStreamAttachment[]? streams = null, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
streams RpcStreamAttachment[]?
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokePipeAsync<TRequest>(string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokePipeAsync<TRequest>(string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task<Pipe> InvokePipeAsync<TRequest>(string service, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokePipeOnInstanceAsync(string, string, string, CancellationToken)
Section titled “ InvokePipeOnInstanceAsync(string, string, string, CancellationToken)”public Task<Pipe> InvokePipeOnInstanceAsync(string service, string instanceId, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
Returns
Section titled “Returns”InvokePipeOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)
Section titled “ InvokePipeOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)”public Task<Pipe> InvokePipeOnInstanceAsync<TRequest>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment[]? streams = null, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
streams RpcStreamAttachment[]?
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokePipeOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokePipeOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task<Pipe> InvokePipeOnInstanceAsync<TRequest>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeStreamAsync(string, string, CancellationToken)
Section titled “ InvokeStreamAsync(string, string, CancellationToken)”public Task<Stream> InvokeStreamAsync(string service, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
Returns
Section titled “Returns”InvokeStreamAsync<TRequest>(string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)
Section titled “ InvokeStreamAsync<TRequest>(string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)”public Task<Stream> InvokeStreamAsync<TRequest>(string service, string method, TRequest request, RpcStreamAttachment[]? streams = null, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
streams RpcStreamAttachment[]?
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeStreamAsync<TRequest>(string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeStreamAsync<TRequest>(string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task<Stream> InvokeStreamAsync<TRequest>(string service, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeStreamOnInstanceAsync(string, string, string, CancellationToken)
Section titled “ InvokeStreamOnInstanceAsync(string, string, string, CancellationToken)”public Task<Stream> InvokeStreamOnInstanceAsync(string service, string instanceId, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
Returns
Section titled “Returns”InvokeStreamOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)
Section titled “ InvokeStreamOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment[]?, CancellationToken)”public Task<Stream> InvokeStreamOnInstanceAsync<TRequest>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment[]? streams = null, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
streams RpcStreamAttachment[]?
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeStreamOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)
Section titled “ InvokeStreamOnInstanceAsync<TRequest>(string, string, string, TRequest, RpcStreamAttachment, CancellationToken)”public Task<Stream> InvokeStreamOnInstanceAsync<TRequest>(string service, string instanceId, string method, TRequest request, RpcStreamAttachment stream, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
stream RpcStreamAttachment
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeValueAsync<TRequest, TResponse>(string, string, TRequest, CancellationToken)
Section titled “ InvokeValueAsync<TRequest, TResponse>(string, string, TRequest, CancellationToken)”public ValueTask<TResponse> InvokeValueAsync<TRequest, TResponse>(string service, string method, TRequest request, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
Returns
Section titled “Returns”ValueTask<TResponse>
Type Parameters
Section titled “Type Parameters”TRequest
TResponse
InvokeValueAsync<TResponse>(string, string, CancellationToken)
Section titled “ InvokeValueAsync<TResponse>(string, string, CancellationToken)”public ValueTask<TResponse> InvokeValueAsync<TResponse>(string service, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
Returns
Section titled “Returns”ValueTask<TResponse>
Type Parameters
Section titled “Type Parameters”TResponse
InvokeValueAsync<TRequest>(string, string, TRequest, CancellationToken)
Section titled “ InvokeValueAsync<TRequest>(string, string, TRequest, CancellationToken)”public ValueTask InvokeValueAsync<TRequest>(string service, string method, TRequest request, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
request TRequest
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeValueAsync(string, string, CancellationToken)
Section titled “ InvokeValueAsync(string, string, CancellationToken)”public ValueTask InvokeValueAsync(string service, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
method string
Returns
Section titled “Returns”InvokeValueOnInstanceAsync<TRequest, TResponse>(string, string, string, TRequest, CancellationToken)
Section titled “ InvokeValueOnInstanceAsync<TRequest, TResponse>(string, string, string, TRequest, CancellationToken)”public ValueTask<TResponse> InvokeValueOnInstanceAsync<TRequest, TResponse>(string service, string instanceId, string method, TRequest request, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
Returns
Section titled “Returns”ValueTask<TResponse>
Type Parameters
Section titled “Type Parameters”TRequest
TResponse
InvokeValueOnInstanceAsync<TResponse>(string, string, string, CancellationToken)
Section titled “ InvokeValueOnInstanceAsync<TResponse>(string, string, string, CancellationToken)”public ValueTask<TResponse> InvokeValueOnInstanceAsync<TResponse>(string service, string instanceId, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
Returns
Section titled “Returns”ValueTask<TResponse>
Type Parameters
Section titled “Type Parameters”TResponse
InvokeValueOnInstanceAsync<TRequest>(string, string, string, TRequest, CancellationToken)
Section titled “ InvokeValueOnInstanceAsync<TRequest>(string, string, string, TRequest, CancellationToken)”public ValueTask InvokeValueOnInstanceAsync<TRequest>(string service, string instanceId, string method, TRequest request, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
request TRequest
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TRequest
InvokeValueOnInstanceAsync(string, string, string, CancellationToken)
Section titled “ InvokeValueOnInstanceAsync(string, string, string, CancellationToken)”public ValueTask InvokeValueOnInstanceAsync(string service, string instanceId, string method, CancellationToken ct = default)Parameters
Section titled “Parameters”service string
instanceId string
method string
Returns
Section titled “Returns”Over(IRpcChannel, ISerializer, RpcPeerOptions?)
Section titled “ Over(IRpcChannel, ISerializer, RpcPeerOptions?)”Creates a peer over channel. Call DotBoxD.Services.Peer.RpcPeer.Start to begin
the read loop (invoking a method also starts it implicitly).
public static RpcPeer Over(IRpcChannel channel, ISerializer serializer, RpcPeerOptions? options = null)Parameters
Section titled “Parameters”channel IRpcChannel
serializer ISerializer
options RpcPeerOptions?
Returns
Section titled “Returns”Provide<TService>(TService)
Section titled “ Provide<TService>(TService)”Provides a local implementation of TService for the other
side to call.
public RpcPeer Provide<TService>(TService implementation) where TService : classParameters
Section titled “Parameters”implementation TService
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TService
Remarks
Section titled “Remarks”Provided services are callable by any peer on this channel; enforce access control at the transport or application layer.
Provide<TService>()
Section titled “ Provide<TService>()”Resolves and provides a local implementation of TService from the configured service provider.
public RpcPeer Provide<TService>() where TService : classReturns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TService
Provide(IServiceDispatcher)
Section titled “ Provide(IServiceDispatcher)”Provides a service via an explicit dispatcher.
public RpcPeer Provide(IServiceDispatcher dispatcher)Parameters
Section titled “Parameters”dispatcher IServiceDispatcher
Returns
Section titled “Returns”ReleaseStream(RpcStreamHandle)
Section titled “ ReleaseStream(RpcStreamHandle)”Releases a stream id reservation that was never attached to an RPC request.
public void ReleaseStream(RpcStreamHandle handle)Parameters
Section titled “Parameters”handle RpcStreamHandle
ReserveStream(RpcStreamKind)
Section titled “ ReserveStream(RpcStreamKind)”Reserves a stream id for a streamed argument sent by this peer.
public RpcStreamHandle ReserveStream(RpcStreamKind kind)Parameters
Section titled “Parameters”kind RpcStreamKind
Returns
Section titled “Returns”Start()
Section titled “ Start()”Begins the read loop. Idempotent; safe to call from a fluent chain.
public RpcPeer Start()Returns
Section titled “Returns”Disconnected
Section titled “ Disconnected”Raised when the read loop ends after a remote close or read error; local close/dispose does not raise it. Handlers run on the teardown path and should not block.
public event EventHandler<RpcDisconnectedEventArgs>? DisconnectedEvent Type
Section titled “Event Type”EventHandler<RpcDisconnectedEventArgs>?
DispatchError
Section titled “ DispatchError”Raised when an inbound request fails outside the service method itself — for example when the response or error frame cannot be sent. Exceptions thrown by a provided service method are not surfaced here; they are converted into an Error frame returned to the caller.
public event EventHandler<RpcDispatchErrorEventArgs>? DispatchErrorEvent Type
Section titled “Event Type”EventHandler<RpcDispatchErrorEventArgs>?
ProtocolError
Section titled “ ProtocolError”Raised when a malformed or unsupported protocol frame is observed.
public event EventHandler<RpcProtocolErrorEventArgs>? ProtocolErrorEvent Type
Section titled “Event Type”EventHandler<RpcProtocolErrorEventArgs>?
ReadError
Section titled “ ReadError”Raised when the read loop fails with a non-cancellation exception.
public event EventHandler<RpcReadErrorEventArgs>? ReadError