语言

JsonRpc.Attach 方法

定义

重载

名称 说明
Attach(Type)

创建符合指定服务器接口的 JSON-RPC 客户端代理。

Attach(Stream, Object)

初始化类的新实例,该实例 JsonRpc 围绕 HeaderDelimitedMessageHandler 使用 JsonMessageFormatter 序列化的消息进行序列化,并立即开始侦听。

Attach(ReadOnlySpan<Type>, JsonRpcProxyOptions)

创建符合指定服务器接口的 JSON-RPC 客户端代理。

Attach(Type, JsonRpcProxyOptions)

创建符合指定服务器接口的 JSON-RPC 客户端代理。

Attach(Stream, Stream, Object)

初始化类的新实例,该实例 JsonRpc 围绕 HeaderDelimitedMessageHandler 使用 JsonMessageFormatter 序列化的消息进行序列化,并立即开始侦听。

Attach<T>(IJsonRpcMessageHandler, JsonRpcProxyOptions)

创建符合指定服务器接口的 JSON-RPC 客户端代理。

Attach<T>(Stream, Stream)

创建符合指定服务器接口的 JSON-RPC 客户端代理。

Attach<T>(Stream)

创建符合指定服务器接口的 JSON-RPC 客户端代理。

Attach<T>()

创建符合指定服务器接口的 JSON-RPC 客户端代理。

Attach<T>(IJsonRpcMessageHandler)

创建符合指定服务器接口的 JSON-RPC 客户端代理。

Attach<T>(JsonRpcProxyOptions)

创建符合指定服务器接口的 JSON-RPC 客户端代理。

Attach(Type)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

创建符合指定服务器接口的 JSON-RPC 客户端代理。

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

参数

interfaceType
Type

描述远程端可用的函数的接口。

返回

生成的代理的实例。

适用于

Attach(Stream, Object)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

初始化类的新实例,该实例 JsonRpc 围绕 HeaderDelimitedMessageHandler 使用 JsonMessageFormatter 序列化的消息进行序列化,并立即开始侦听。

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

参数

stream
Stream

要发送和接收 RPC 消息的双向流。

target
Object

传入 RPC 请求到达时要调用的可选目标对象。

返回

初始化和侦 JsonRpc 听对象。

适用于

Attach(ReadOnlySpan<Type>, JsonRpcProxyOptions)

创建符合指定服务器接口的 JSON-RPC 客户端代理。

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

参数

interfaceTypes
ReadOnlySpan<Type>

描述远程端可用的函数的接口。

options
JsonRpcProxyOptions

客户端代理连接方式的一组自定义设置。 如果 null,将使用默认选项。

返回

生成的代理的实例。

适用于

Attach(Type, JsonRpcProxyOptions)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

创建符合指定服务器接口的 JSON-RPC 客户端代理。

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

参数

interfaceType
Type

描述远程端可用的函数的接口。

options
JsonRpcProxyOptions

客户端代理连接方式的一组自定义设置。 如果 null,将使用默认选项。

返回

生成的代理的实例。

适用于

Attach(Stream, Stream, Object)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

初始化类的新实例,该实例 JsonRpc 围绕 HeaderDelimitedMessageHandler 使用 JsonMessageFormatter 序列化的消息进行序列化,并立即开始侦听。

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

参数

sendingStream
Stream

用于传输消息的流。 可以为 null。

receivingStream
Stream

用于接收消息的流。 可以为 null。

target
Object

传入 RPC 请求到达时要调用的可选目标对象。

返回

初始化和侦 JsonRpc 听对象。

适用于

Attach<T>(IJsonRpcMessageHandler, JsonRpcProxyOptions)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

创建符合指定服务器接口的 JSON-RPC 客户端代理。

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

类型参数

T

描述远程端可用的函数的接口。

参数

handler
IJsonRpcMessageHandler

要使用的消息处理程序。

options
JsonRpcProxyOptions

客户端代理连接方式的一组自定义设置。 如果 null,将使用默认选项。

返回

T

生成的代理的实例。 除了实现 T之外,它还实现 IDisposable 并应释放以关闭连接。

适用于

Attach<T>(Stream, Stream)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

创建符合指定服务器接口的 JSON-RPC 客户端代理。

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

类型参数

T

描述远程端可用的函数的接口。

参数

sendingStream
Stream

用于传输消息的流。 可以为 null。

receivingStream
Stream

用于接收消息的流。 可以为 null。

返回

T

生成的代理的实例。 除了实现 T之外,它还实现 IDisposable 并应释放以关闭连接。

适用于

Attach<T>(Stream)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

创建符合指定服务器接口的 JSON-RPC 客户端代理。

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

类型参数

T

描述远程端可用的函数的接口。

参数

stream
Stream

用于发送和接收 JSON-RPC 消息的双向流。

返回

T

生成的代理的实例。 除了实现 T之外,它还实现 IDisposable 并应释放以关闭连接。

适用于

Attach<T>()

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

创建符合指定服务器接口的 JSON-RPC 客户端代理。

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

类型参数

T

描述远程端可用的函数的接口。

返回

T

生成的代理的实例。

适用于

Attach<T>(IJsonRpcMessageHandler)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

创建符合指定服务器接口的 JSON-RPC 客户端代理。

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

类型参数

T

描述远程端可用的函数的接口。

参数

handler
IJsonRpcMessageHandler

要使用的消息处理程序。

返回

T

生成的代理的实例。 除了实现 T之外,它还实现 IDisposable 并应释放以关闭连接。

适用于

Attach<T>(JsonRpcProxyOptions)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs

创建符合指定服务器接口的 JSON-RPC 客户端代理。

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

类型参数

T

描述远程端可用的函数的接口。

参数

options
JsonRpcProxyOptions

客户端代理连接方式的一组自定义设置。 如果 null,将使用默认选项。

返回

T

生成的代理的实例。

适用于