Table of Contents

Interface IJsonRpcDescriptor

Namespace
Nerdbank.JsonRpc.BrokeredServices
Assembly
Nerdbank.JsonRpc.dll

Describes a service's wire contract and constructs its server connection.

public interface IJsonRpcDescriptor

Remarks

Implementations must expose only the declared contract, not arbitrary implementation methods.

Properties

AdditionalInterfaces

Gets known additional contracts and their generated shapes, not implementation capabilities.

IReadOnlyList<ServiceInterface> AdditionalInterfaces { get; }

Property Value

IReadOnlyList<ServiceInterface>

Moniker

Gets the identity of the service.

ServiceMoniker Moniker { get; }

Property Value

ServiceMoniker

RpcOptions

Gets connection policies, including direct-call exception disclosure.

JsonRpcOptions RpcOptions { get; }

Property Value

JsonRpcOptions

Methods

AddRpcTargetCore(JsonRpc, object, IReadOnlyList<ServiceInterface>)

Registers the primary service contract and explicitly registered additional interfaces.

void AddRpcTargetCore(JsonRpc connection, object target, IReadOnlyList<ServiceInterface> additionalInterfaces)

Parameters

connection JsonRpc

The unstarted connection.

target object

The service implementation.

additionalInterfaces IReadOnlyList<ServiceInterface>

The interfaces supported by this registration.

Remarks

This type-erased infrastructure entry point is for catalog dispatch. Use the typed descriptor's AddRpcTarget method when the contract type is known.

CreateCallbackProxy(JsonRpc)

Constructs the client's callback proxy on an unstarted server connection.

object? CreateCallbackProxy(JsonRpc connection)

Parameters

connection JsonRpc

The server connection.

Returns

object

The callback proxy, or null if the service has no callback contract.

CreateConnection(IDuplexPipe, ServiceRpcContext?)

Constructs an unstarted connection. Successful construction transfers pipe ownership.

JsonRpc CreateConnection(IDuplexPipe pipe, ServiceRpcContext? context = null)

Parameters

pipe IDuplexPipe

The connected transport.

context ServiceRpcContext

Runtime infrastructure for this connection.

Returns

JsonRpc

The connection, whose owner must dispose it.

Remarks

Implementations that initialize a transport wrapper may transfer ownership before construction completes, including on failure.

CreateLocalCallback(object, ILogger<ServiceProxyContext>?)

Constructs a direct callback boundary without owning the caller's target.

object CreateLocalCallback(object target, ILogger<ServiceProxyContext>? logger = null)

Parameters

target object

The caller-owned callback implementation.

logger ILogger<ServiceProxyContext>

The direct callback logger.

Returns

object

The generated, activation-owned callback boundary.

CreateLocalTarget(ServiceProxyContext, IReadOnlyList<ServiceInterface>)

Constructs a generated server-side forwarding target for asynchronous activation.

object CreateLocalTarget(ServiceProxyContext context, IReadOnlyList<ServiceInterface> additionalInterfaces)

Parameters

context ServiceProxyContext

The activation and lifetime context.

additionalInterfaces IReadOnlyList<ServiceInterface>

The registration's supported interfaces.

Returns

object

The generated server target.