Compartir a través de


JsonRpc.InvokeCoreAsync Método

Definición

Sobrecargas

InvokeCoreAsync<TResult>(RequestId, String, IReadOnlyList<Object>, CancellationToken)

Invoca el método RPC especificado.

InvokeCoreAsync<TResult>(Nullable<Int32>, String, IReadOnlyList<Object>, CancellationToken)

Invoca el método RPC especificado.

InvokeCoreAsync<TResult>(Nullable<Int64>, String, IReadOnlyList<Object>, CancellationToken)
Obsoletos.

Invoca el método RPC especificado.

InvokeCoreAsync<TResult>(RequestId, String, IReadOnlyList<Object>, CancellationToken, Boolean)

Invoca el método RPC especificado.

InvokeCoreAsync<TResult>(Nullable<Int32>, String, IReadOnlyList<Object>, CancellationToken, Boolean)

Invoca el método RPC especificado.

InvokeCoreAsync<TResult>(Nullable<Int64>, String, IReadOnlyList<Object>, CancellationToken, Boolean)
Obsoletos.

Invoca un método determinado en un servidor JSON-RPC.

InvokeCoreAsync<TResult>(RequestId, String, IReadOnlyList<Object>, IReadOnlyList<Type>, IReadOnlyDictionary<String,Type>, CancellationToken, Boolean)

Invoca un método determinado en un servidor JSON-RPC.

InvokeCoreAsync<TResult>(RequestId, String, IReadOnlyList<Object>, CancellationToken)

Invoca el método RPC especificado.

protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (StreamJsonRpc.RequestId id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Threading.CancellationToken cancellationToken);
member this.InvokeCoreAsync : StreamJsonRpc.RequestId * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As RequestId, targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken) As Task(Of TResult)

Parámetros de tipo

TResult

Tipo de valor devuelto del método RPC.

Parámetros

id
RequestId

Identificador establecido por el cliente que DEBE contener un valor String, Number o NULL si se incluye. Si no se incluye, se supone que es una notificación.

targetName
String

Nombre del método que se va a invocar. No debe estar vacío ni ser NULL.

arguments
IReadOnlyList<Object>

Argumentos que se van a pasar al método invocado. Deben ser serializables mediante el objeto seleccionado IJsonRpcMessageFormatter. Si nulles , no se pasan argumentos.

cancellationToken
CancellationToken

Token cuya cancelación debe indicar al servidor que detenga el procesamiento de esta solicitud.

Devoluciones

Task<TResult>

Tarea cuyo resultado es la respuesta deserializada del servidor JSON-RPC.

Se aplica a

InvokeCoreAsync<TResult>(Nullable<Int32>, String, IReadOnlyList<Object>, CancellationToken)

Invoca el método RPC especificado.

protected virtual System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (int? id, string targetName, System.Collections.Generic.IReadOnlyList<object> arguments, System.Threading.CancellationToken cancellationToken);
abstract member InvokeCoreAsync : Nullable<int> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
override this.InvokeCoreAsync : Nullable<int> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Protected Overridable Function InvokeCoreAsync(Of TResult) (id As Nullable(Of Integer), targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken) As Task(Of TResult)

Parámetros de tipo

TResult

Tipo de valor devuelto del método RPC

Parámetros

id
Nullable<Int32>

Identificador establecido por el cliente que DEBE contener un valor String, Number o NULL si se incluye. Si no se incluye, se supone que es una notificación.

targetName
String

Nombre del método que se va a invocar.

arguments
IReadOnlyList<Object>

Argumentos que se van a pasar al método invocado. Si es NULL, no se pasan argumentos.

cancellationToken
CancellationToken

Token cuya cancelación debe indicar al servidor que detenga el procesamiento de esta solicitud.

Devoluciones

Task<TResult>

Tarea cuyo resultado es la respuesta deserializada del servidor JSON-RPC.

Se aplica a

InvokeCoreAsync<TResult>(Nullable<Int64>, String, IReadOnlyList<Object>, CancellationToken)

Precaución

Use the InvokeCoreAsync(RequestId, ...) overload instead.

Invoca el método RPC especificado.

protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (long? id, string targetName, System.Collections.Generic.IReadOnlyList<object> arguments, System.Threading.CancellationToken cancellationToken);
[System.Obsolete("Use the InvokeCoreAsync(RequestId, ...) overload instead.")]
protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (long? id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Threading.CancellationToken cancellationToken);
member this.InvokeCoreAsync : Nullable<int64> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
[<System.Obsolete("Use the InvokeCoreAsync(RequestId, ...) overload instead.")>]
member this.InvokeCoreAsync : Nullable<int64> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As Nullable(Of Long), targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken) As Task(Of TResult)

Parámetros de tipo

TResult

Tipo de valor devuelto del método RPC.

Parámetros

id
Nullable<Int64>

Identificador establecido por el cliente que DEBE contener un valor String, Number o NULL si se incluye. Si no se incluye, se supone que es una notificación.

targetName
String

Nombre del método que se va a invocar. No debe estar vacío ni ser NULL.

arguments
IReadOnlyList<Object>

Argumentos que se van a pasar al método invocado. Deben ser serializables mediante el objeto seleccionado IJsonRpcMessageFormatter. Si nulles , no se pasan argumentos.

cancellationToken
CancellationToken

Token cuya cancelación debe indicar al servidor que detenga el procesamiento de esta solicitud.

Devoluciones

Task<TResult>

Tarea cuyo resultado es la respuesta deserializada del servidor JSON-RPC.

Atributos

Se aplica a

InvokeCoreAsync<TResult>(RequestId, String, IReadOnlyList<Object>, CancellationToken, Boolean)

Invoca el método RPC especificado.

protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (StreamJsonRpc.RequestId id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
member this.InvokeCoreAsync : StreamJsonRpc.RequestId * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As RequestId, targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken, isParameterObject As Boolean) As Task(Of TResult)

Parámetros de tipo

TResult

Tipo de valor devuelto del método RPC.

Parámetros

id
RequestId

Identificador establecido por el cliente. Si se proporciona el valor predeterminado, se supone que es una notificación.

targetName
String

Nombre del método que se va a invocar.

arguments
IReadOnlyList<Object>

Argumentos que se van a pasar al método invocado. Si es NULL, no se pasan argumentos.

cancellationToken
CancellationToken

Token cuya cancelación debe indicar al servidor que detenga el procesamiento de esta solicitud.

isParameterObject
Boolean

Valor que indica si el parámetro se debe pasar como un objeto .

Devoluciones

Task<TResult>

Tarea cuyo resultado es la respuesta deserializada del servidor JSON-RPC.

Se aplica a

InvokeCoreAsync<TResult>(Nullable<Int32>, String, IReadOnlyList<Object>, CancellationToken, Boolean)

Invoca el método RPC especificado.

protected virtual System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (int? id, string targetName, System.Collections.Generic.IReadOnlyList<object> arguments, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
abstract member InvokeCoreAsync : Nullable<int> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
override this.InvokeCoreAsync : Nullable<int> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
Protected Overridable Function InvokeCoreAsync(Of TResult) (id As Nullable(Of Integer), targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken, isParameterObject As Boolean) As Task(Of TResult)

Parámetros de tipo

TResult

Tipo de valor devuelto del método RPC

Parámetros

id
Nullable<Int32>

Identificador establecido por el cliente que DEBE contener un valor String, Number o NULL si se incluye. Si no se incluye, se supone que es una notificación.

targetName
String

Nombre del método que se va a invocar.

arguments
IReadOnlyList<Object>

Argumentos que se van a pasar al método invocado. Si es NULL, no se pasan argumentos.

cancellationToken
CancellationToken

Token cuya cancelación debe indicar al servidor que detenga el procesamiento de esta solicitud.

isParameterObject
Boolean

Valor que indica si el parámetro se debe pasar como un objeto .

Devoluciones

Task<TResult>

Tarea cuyo resultado es la respuesta deserializada del servidor JSON-RPC.

Se aplica a

InvokeCoreAsync<TResult>(Nullable<Int64>, String, IReadOnlyList<Object>, CancellationToken, Boolean)

Precaución

Use the InvokeCoreAsync(RequestId, ...) overload instead.

Invoca un método determinado en un servidor JSON-RPC.

protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (long? id, string targetName, System.Collections.Generic.IReadOnlyList<object> arguments, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
[System.Obsolete("Use the InvokeCoreAsync(RequestId, ...) overload instead.")]
protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (long? id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
member this.InvokeCoreAsync : Nullable<int64> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
[<System.Obsolete("Use the InvokeCoreAsync(RequestId, ...) overload instead.")>]
member this.InvokeCoreAsync : Nullable<int64> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As Nullable(Of Long), targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken, isParameterObject As Boolean) As Task(Of TResult)

Parámetros de tipo

TResult

Tipo de valor devuelto del método RPC.

Parámetros

id
Nullable<Int64>

Identificador establecido por el cliente. Si se proporciona el valor predeterminado, se supone que es una notificación.

targetName
String

Nombre del método que se va a invocar. No debe estar vacío ni ser NULL.

arguments
IReadOnlyList<Object>

Argumentos que se van a pasar al método invocado. Deben ser serializables mediante el objeto seleccionado IJsonRpcMessageFormatter. Si nulles , no se pasan argumentos.

cancellationToken
CancellationToken

Token cuya cancelación debe indicar al servidor que detenga el procesamiento de esta solicitud.

isParameterObject
Boolean

Valor que indica si el parámetro se debe pasar como un objeto .

Devoluciones

Task<TResult>

Tarea cuyo resultado es la respuesta deserializada del servidor JSON-RPC.

Atributos

Se aplica a

InvokeCoreAsync<TResult>(RequestId, String, IReadOnlyList<Object>, IReadOnlyList<Type>, IReadOnlyDictionary<String,Type>, CancellationToken, Boolean)

Invoca un método determinado en un servidor JSON-RPC.

protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (StreamJsonRpc.RequestId id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Collections.Generic.IReadOnlyList<Type>? positionalArgumentDeclaredTypes, System.Collections.Generic.IReadOnlyDictionary<string,Type>? namedArgumentDeclaredTypes, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
member this.InvokeCoreAsync : StreamJsonRpc.RequestId * string * System.Collections.Generic.IReadOnlyList<obj> * System.Collections.Generic.IReadOnlyList<Type> * System.Collections.Generic.IReadOnlyDictionary<string, Type> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As RequestId, targetName As String, arguments As IReadOnlyList(Of Object), positionalArgumentDeclaredTypes As IReadOnlyList(Of Type), namedArgumentDeclaredTypes As IReadOnlyDictionary(Of String, Type), cancellationToken As CancellationToken, isParameterObject As Boolean) As Task(Of TResult)

Parámetros de tipo

TResult

Tipo de valor devuelto del método RPC.

Parámetros

id
RequestId

Identificador establecido por el cliente. Si se proporciona el valor predeterminado, se supone que es una notificación.

targetName
String

Nombre del método que se va a invocar. No debe estar vacío ni ser NULL.

arguments
IReadOnlyList<Object>

Argumentos que se van a pasar al método invocado. Deben ser serializables mediante el objeto seleccionado IJsonRpcMessageFormatter. Si nulles , no se pasan argumentos.

positionalArgumentDeclaredTypes
IReadOnlyList<Type>

Lista de Type objetos que describen cómo se espera que el servidor escriba cada elemento de arguments . Si se especifica, debe tener exactamente la misma longitud arguments que y no contener elementos null . Este valor se omite cuando isParameterObject es true.

namedArgumentDeclaredTypes
IReadOnlyDictionary<String,Type>

Diccionario de Type objetos que describen cómo se escribe cada entrada del IReadOnlyDictionary<TKey,TValue> elemento proporcionado en el único elemento de arguments que se espera que escriba el servidor. Si se especifica, debe tener exactamente el mismo conjunto de claves que el diccionario contenido en el primer elemento de argumentsy no contiene ningún null valor.

cancellationToken
CancellationToken

Token cuya cancelación debe indicar al servidor que detenga el procesamiento de esta solicitud.

isParameterObject
Boolean

Valor que indica si el parámetro se debe pasar como un objeto .

Devoluciones

Task<TResult>

Tarea que se completa con la respuesta del servidor JSON-RPC.

Excepciones

Se produce después cancellationToken de cancelarse. Si la solicitud ya se ha transmitido, la excepción solo se produce después de que el servidor haya recibido la notificación de cancelación y haya respondido a ella. Si el servidor completa la solicitud en lugar de cancelarla, no se producirá esta excepción. Cuando la conexión se quita antes de recibir una respuesta, esta excepción se produce si cancellationToken se ha cancelado.

Una clase base común para una variedad de excepciones RPC que se pueden producir. Algunos tipos derivados comunes se enumeran individualmente.

Se produce cuando se devuelve un error desde el servidor en consecuencia de ejecutar el método solicitado.

Se produce cuando el servidor informa de que no se encontró ningún método coincidente para invocar.

Si targetName es null.

Se produce cuando targetName está vacío.

Si esta instancia de ya se ha eliminado antes de JsonRpc esta llamada.

Se produce cuando la conexión finaliza (por cualquier lado) antes de la solicitud o mientras la solicitud está en curso, a menos que cancellationToken ya esté señalizado.

Cualquier excepción producida por IJsonRpcMessageFormatter (normalmente debido a errores de serialización). Cuando se usa JsonMessageFormatter , debe ser Newtonsoft.Json.JsonSerializationException. Cuando se usa MessagePackFormatter , debe ser MessagePack.MessagePackSerializationException.

Se aplica a