JsonRpc.Attach Method

Definition

Overloads

Attach(Type)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

Attach(Stream, Object)

Initializes a new instance of the JsonRpc class that uses HeaderDelimitedMessageHandler around messages serialized using the JsonMessageFormatter, and immediately starts listening.

Attach(Type, JsonRpcProxyOptions)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

Attach(Stream, Stream, Object)

Initializes a new instance of the JsonRpc class that uses HeaderDelimitedMessageHandler around messages serialized using the JsonMessageFormatter, and immediately starts listening.

Attach<T>(Stream, Stream)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

Attach<T>(IJsonRpcMessageHandler, JsonRpcProxyOptions)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

Attach<T>(Stream)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

Attach<T>(IJsonRpcMessageHandler)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

Attach<T>()

Creates a JSON-RPC client proxy that conforms to the specified server interface.

Attach<T>(JsonRpcProxyOptions)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

Attach(Type)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

public object Attach (Type interfaceType);
member this.Attach : Type -> obj
Public Function Attach (interfaceType As Type) As Object

Parameters

interfaceType
Type

The interface that describes the functions available on the remote end.

Returns

An instance of the generated proxy.

Applies to

Attach(Stream, Object)

Initializes a new instance of the JsonRpc class that uses HeaderDelimitedMessageHandler around messages serialized using the JsonMessageFormatter, and immediately starts listening.

public static StreamJsonRpc.JsonRpc Attach (System.IO.Stream stream, object target = default);
public static StreamJsonRpc.JsonRpc Attach (System.IO.Stream stream, object? target = default);
static member Attach : System.IO.Stream * obj -> StreamJsonRpc.JsonRpc
Public Shared Function Attach (stream As Stream, Optional target As Object = Nothing) As JsonRpc

Parameters

stream
Stream

A bidirectional stream to send and receive RPC messages on.

target
Object

An optional target object to invoke when incoming RPC requests arrive.

Returns

The initialized and listening JsonRpc object.

Applies to

Attach(Type, JsonRpcProxyOptions)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

public object Attach (Type interfaceType, StreamJsonRpc.JsonRpcProxyOptions options);
public object Attach (Type interfaceType, StreamJsonRpc.JsonRpcProxyOptions? options);
member this.Attach : Type * StreamJsonRpc.JsonRpcProxyOptions -> obj
Public Function Attach (interfaceType As Type, options As JsonRpcProxyOptions) As Object

Parameters

interfaceType
Type

The interface that describes the functions available on the remote end.

options
JsonRpcProxyOptions

A set of customizations for how the client proxy is wired up. If null, default options will be used.

Returns

An instance of the generated proxy.

Applies to

Attach(Stream, Stream, Object)

Initializes a new instance of the JsonRpc class that uses HeaderDelimitedMessageHandler around messages serialized using the JsonMessageFormatter, and immediately starts listening.

public static StreamJsonRpc.JsonRpc Attach (System.IO.Stream sendingStream, System.IO.Stream receivingStream, object target = default);
public static StreamJsonRpc.JsonRpc Attach (System.IO.Stream? sendingStream, System.IO.Stream? receivingStream, object? target = default);
static member Attach : System.IO.Stream * System.IO.Stream * obj -> StreamJsonRpc.JsonRpc
Public Shared Function Attach (sendingStream As Stream, receivingStream As Stream, Optional target As Object = Nothing) As JsonRpc

Parameters

sendingStream
Stream

The stream used to transmit messages. May be null.

receivingStream
Stream

The stream used to receive messages. May be null.

target
Object

An optional target object to invoke when incoming RPC requests arrive.

Returns

The initialized and listening JsonRpc object.

Applies to

Attach<T>(Stream, Stream)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

public static T Attach<T> (System.IO.Stream sendingStream, System.IO.Stream receivingStream) where T : class;
public static T Attach<T> (System.IO.Stream? sendingStream, System.IO.Stream? receivingStream) where T : class;
static member Attach : System.IO.Stream * System.IO.Stream -> 'T (requires 'T : null)
Public Shared Function Attach(Of T As Class) (sendingStream As Stream, receivingStream As Stream) As T

Type Parameters

T

The interface that describes the functions available on the remote end.

Parameters

sendingStream
Stream

The stream used to transmit messages. May be null.

receivingStream
Stream

The stream used to receive messages. May be null.

Returns

T

An instance of the generated proxy. In addition to implementing T, it also implements IDisposable and should be disposed of to close the connection.

Applies to

Attach<T>(IJsonRpcMessageHandler, JsonRpcProxyOptions)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

public static T Attach<T> (StreamJsonRpc.IJsonRpcMessageHandler handler, StreamJsonRpc.JsonRpcProxyOptions options) where T : class;
public static T Attach<T> (StreamJsonRpc.IJsonRpcMessageHandler handler, StreamJsonRpc.JsonRpcProxyOptions? options) where T : class;
static member Attach : StreamJsonRpc.IJsonRpcMessageHandler * StreamJsonRpc.JsonRpcProxyOptions -> 'T (requires 'T : null)
Public Shared Function Attach(Of T As Class) (handler As IJsonRpcMessageHandler, options As JsonRpcProxyOptions) As T

Type Parameters

T

The interface that describes the functions available on the remote end.

Parameters

handler
IJsonRpcMessageHandler

The message handler to use.

options
JsonRpcProxyOptions

A set of customizations for how the client proxy is wired up. If null, default options will be used.

Returns

T

An instance of the generated proxy. In addition to implementing T, it also implements IDisposable and should be disposed of to close the connection.

Applies to

Attach<T>(Stream)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

public static T Attach<T> (System.IO.Stream stream) where T : class;
static member Attach : System.IO.Stream -> 'T (requires 'T : null)
Public Shared Function Attach(Of T As Class) (stream As Stream) As T

Type Parameters

T

The interface that describes the functions available on the remote end.

Parameters

stream
Stream

The bidirectional stream used to send and receive JSON-RPC messages.

Returns

T

An instance of the generated proxy. In addition to implementing T, it also implements IDisposable and should be disposed of to close the connection.

Applies to

Attach<T>(IJsonRpcMessageHandler)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

public static T Attach<T> (StreamJsonRpc.IJsonRpcMessageHandler handler) where T : class;
static member Attach : StreamJsonRpc.IJsonRpcMessageHandler -> 'T (requires 'T : null)
Public Shared Function Attach(Of T As Class) (handler As IJsonRpcMessageHandler) As T

Type Parameters

T

The interface that describes the functions available on the remote end.

Parameters

handler
IJsonRpcMessageHandler

The message handler to use.

Returns

T

An instance of the generated proxy. In addition to implementing T, it also implements IDisposable and should be disposed of to close the connection.

Applies to

Attach<T>()

Creates a JSON-RPC client proxy that conforms to the specified server interface.

public T Attach<T> () where T : class;
member this.Attach : unit -> 'T (requires 'T : null)
Public Function Attach(Of T As Class) () As T

Type Parameters

T

The interface that describes the functions available on the remote end.

Returns

T

An instance of the generated proxy.

Applies to

Attach<T>(JsonRpcProxyOptions)

Creates a JSON-RPC client proxy that conforms to the specified server interface.

public T Attach<T> (StreamJsonRpc.JsonRpcProxyOptions options) where T : class;
public T Attach<T> (StreamJsonRpc.JsonRpcProxyOptions? options) where T : class;
member this.Attach : StreamJsonRpc.JsonRpcProxyOptions -> 'T (requires 'T : null)
Public Function Attach(Of T As Class) (options As JsonRpcProxyOptions) As T

Type Parameters

T

The interface that describes the functions available on the remote end.

Parameters

options
JsonRpcProxyOptions

A set of customizations for how the client proxy is wired up. If null, default options will be used.

Returns

T

An instance of the generated proxy.

Applies to