JsonRpc.NotifyAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| NotifyAsync(String, Object) |
在 JSON-RPC 服务器上调用给定的方法,而无需等待其响应。 |
| NotifyAsync(String, Object[]) |
在服务器上调用一个方法,不要等待其完成、触发和忘记样式。 |
| NotifyAsync(String, Object[], IReadOnlyList<Type>) |
在 JSON-RPC 服务器上调用给定的方法,而无需等待其响应。 |
NotifyAsync(String, Object)
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- 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[])
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- JsonRpc.cs
- Source:
- 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 时,将忽略此值。
返回
将通知请求发送到服务器时完成的任务。
注解
将忽略服务器端发生的任何错误。