語言

JsonRpc.NotifyAsync 方法

定義

多載

名稱 Description
NotifyAsync(String, Object)

在 JSON-RPC 伺服器上叫用指定的方法,而不需等候其回應。

NotifyAsync(String, Object[])

在伺服器上叫用方法,不要等待其完成、引發和忘記樣式。

NotifyAsync(String, Object[], IReadOnlyList<Type>)

在 JSON-RPC 伺服器上叫用指定的方法,而不需等候其回應。

NotifyAsync(String, Object)

來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs

在 JSON-RPC 伺服器上叫用指定的方法,而不需等候其回應。

public System.Threading.Tasks.Task NotifyAsync(string targetName, object argument);
public System.Threading.Tasks.Task NotifyAsync(string targetName, object? argument);
member this.NotifyAsync : string * obj -> System.Threading.Tasks.Task
Public Function NotifyAsync (targetName As String, argument As Object) As Task

參數

targetName
String

要叫用的方法名稱。 不得為 Null 或空白。

argument
Object

方法自變數,必須使用選取的 IJsonRpcMessageFormatter串行化。

傳回

當通知要求傳送至伺服器時完成的工作。

例外狀況

如果 targetName 為 null。

當 targetName 是空的時擲回。

如果這個實例的 JsonRpc 已在呼叫之前處置。

在傳輸要求時終止連接時擲回 (由任一端)。

IJsonRpcMessageFormatter 擲回的任何例外狀況(通常是因為串行化失敗所致)。 使用 JsonMessageFormatter 時,應該 Newtonsoft.Json.JsonSerializationException。 使用 MessagePackFormatter 時,應該 MessagePack.MessagePackSerializationException。

備註

忽略伺服器端發生的任何錯誤。

適用於

NotifyAsync(String, Object[])

來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs

在伺服器上叫用方法,不要等待其完成、引發和忘記樣式。

public System.Threading.Tasks.Task NotifyAsync(string targetName, params object[] arguments);
public System.Threading.Tasks.Task NotifyAsync(string targetName, params object?[]? arguments);
member this.NotifyAsync : string * obj[] -> System.Threading.Tasks.Task
Public Function NotifyAsync (targetName As String, ParamArray arguments As Object()) As Task

參數

targetName
String

在伺服器上叫用的方法名稱。 不得為 Null 或空字串。

arguments
Object[]

方法自變數,必須可串行化為 JSON。

傳回

當通知要求傳送至伺服器時完成的工作。

例外狀況

如果 targetName 為 null。

如果已處置這個 JsonRpc 實例。

備註

忽略伺服器端發生的任何錯誤。

適用於

NotifyAsync(String, Object[], IReadOnlyList<Type>)

在 JSON-RPC 伺服器上叫用指定的方法,而不需等候其回應。

public System.Threading.Tasks.Task NotifyAsync(string targetName, object?[]? arguments, System.Collections.Generic.IReadOnlyList<Type>? argumentDeclaredTypes);
member this.NotifyAsync : string * obj[] * System.Collections.Generic.IReadOnlyList<Type> -> System.Threading.Tasks.Task
Public Function NotifyAsync (targetName As String, arguments As Object(), argumentDeclaredTypes As IReadOnlyList(Of Type)) As Task

參數

targetName
String

要叫用的方法名稱。 不得為 Null 或空白。

arguments
Object[]

要傳遞至叫用方法的自變數。 必須使用選取的 IJsonRpcMessageFormatter串行化它們。 如果 null,則不會傳遞任何自變數。

argumentDeclaredTypes
IReadOnlyList<Type>

描述伺服器預期 Type 中每個元素如何輸入的 arguments 物件清單。 如果指定,這個長度必須與 arguments 完全相同,而且不包含任何 null 專案。 當 isParameterObject 為 true 時,會忽略此值。

傳回

當通知要求傳送至伺服器時完成的工作。

備註

忽略伺服器端發生的任何錯誤。

適用於