JsonRpc.Attach 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Attach(Type) |
建立符合指定伺服器介面的 JSON-RPC 用戶端代理。 |
| Attach(Stream, Object) |
初始化一個使用HeaderDelimitedMessageHandler以JsonMessageFormatter序列化訊息的類別新實例JsonRpc,並立即開始監聽。 |
| Attach(ReadOnlySpan<Type>, JsonRpcProxyOptions) |
建立符合指定伺服器介面的 JSON-RPC 用戶端代理。 |
| Attach(Type, JsonRpcProxyOptions) |
建立符合指定伺服器介面的 JSON-RPC 用戶端代理。 |
| Attach(Stream, Stream, Object) |
初始化一個使用HeaderDelimitedMessageHandler以JsonMessageFormatter序列化訊息的類別新實例JsonRpc,並立即開始監聽。 |
| 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)
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- 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)
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
初始化一個使用HeaderDelimitedMessageHandler以JsonMessageFormatter序列化訊息的類別新實例JsonRpc,並立即開始監聽。
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)
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- 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)
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
初始化一個使用HeaderDelimitedMessageHandler以JsonMessageFormatter序列化訊息的類別新實例JsonRpc,並立即開始監聽。
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)
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- 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之外,它還實施 IDisposable 並應該處理以關閉連線。
適用於
Attach<T>(Stream, Stream)
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- 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之外,它還實施 IDisposable 並應該處理以關閉連線。
適用於
Attach<T>(Stream)
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- 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之外,它還實施 IDisposable 並應該處理以關閉連線。
適用於
Attach<T>()
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- 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
描述遠端可用功能的介面。
傳回
產生代理的實例。
適用於
Attach<T>(IJsonRpcMessageHandler)
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- 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之外,它還實施 IDisposable 並應該處理以關閉連線。
適用於
Attach<T>(JsonRpcProxyOptions)
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- JsonRpc.cs
- 來源:
- 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,則會使用預設選項。
傳回
產生代理的實例。