JsonRpc.InvokeCoreAsync Metodo

Definizione

Overload

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

Richiama il metodo RPC specificato.

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

Richiama il metodo RPC specificato

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

Richiama il metodo RPC specificato.

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

Richiama il metodo RPC specificato.

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

Richiama il metodo RPC specificato

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

Richiama un determinato metodo in un server JSON-RPC.

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

Richiama un determinato metodo in un server JSON-RPC.

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

Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs

Richiama il metodo RPC specificato.

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)

Parametri di tipo

TResult

Tipo restituito del metodo RPC.

Parametri

id
RequestId

Identificatore stabilito dal client che DEVE contenere un valore String, Number o NULL, se incluso. Se non è incluso, si presuppone che sia una notifica.

targetName
String

Nome del metodo da richiamare. Non deve essere null o vuoto.

arguments
IReadOnlyList<Object>

Argomenti da passare al metodo richiamato. Devono essere serializzabili usando il IJsonRpcMessageFormatterselezionato. Se null, non vengono passati argomenti.

cancellationToken
CancellationToken

Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.

Valori restituiti

Task<TResult>

Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.

Si applica a

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

Origine:
JsonRpc.cs

Richiama il metodo RPC specificato

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)

Parametri di tipo

TResult

Tipo restituito del metodo RPC

Parametri

id
Nullable<Int32>

Identificatore stabilito dal client che DEVE contenere un valore String, Number o NULL, se incluso. Se non è incluso, si presuppone che sia una notifica.

targetName
String

Nome del metodo da richiamare.

arguments
IReadOnlyList<Object>

Argomenti da passare al metodo richiamato. Se null, non vengono passati argomenti.

cancellationToken
CancellationToken

Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.

Valori restituiti

Task<TResult>

Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.

Si applica a

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

Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs

Attenzione

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

Richiama il metodo RPC specificato.

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)

Parametri di tipo

TResult

Tipo restituito del metodo RPC.

Parametri

id
Nullable<Int64>

Identificatore stabilito dal client che DEVE contenere un valore String, Number o NULL, se incluso. Se non è incluso, si presuppone che sia una notifica.

targetName
String

Nome del metodo da richiamare. Non deve essere null o vuoto.

arguments
IReadOnlyList<Object>

Argomenti da passare al metodo richiamato. Devono essere serializzabili usando il IJsonRpcMessageFormatterselezionato. Se null, non vengono passati argomenti.

cancellationToken
CancellationToken

Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.

Valori restituiti

Task<TResult>

Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.

Attributi

Si applica a

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

Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs

Richiama il metodo RPC specificato.

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)

Parametri di tipo

TResult

Tipo restituito del metodo RPC.

Parametri

id
RequestId

Identificatore stabilito dal client. Se viene specificato il valore predefinito, si presuppone che sia una notifica.

targetName
String

Nome del metodo da richiamare.

arguments
IReadOnlyList<Object>

Argomenti da passare al metodo richiamato. Se null, non vengono passati argomenti.

cancellationToken
CancellationToken

Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.

isParameterObject
Boolean

Valore che indica se il parametro deve essere passato come oggetto .

Valori restituiti

Task<TResult>

Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.

Si applica a

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

Origine:
JsonRpc.cs

Richiama il metodo RPC specificato

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)

Parametri di tipo

TResult

Tipo restituito del metodo RPC

Parametri

id
Nullable<Int32>

Identificatore stabilito dal client che DEVE contenere un valore String, Number o NULL, se incluso. Se non è incluso, si presuppone che sia una notifica.

targetName
String

Nome del metodo da richiamare.

arguments
IReadOnlyList<Object>

Argomenti da passare al metodo richiamato. Se null, non vengono passati argomenti.

cancellationToken
CancellationToken

Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.

isParameterObject
Boolean

Valore che indica se il parametro deve essere passato come oggetto .

Valori restituiti

Task<TResult>

Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.

Si applica a

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

Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs

Attenzione

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

Richiama un determinato metodo in un server 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)

Parametri di tipo

TResult

Tipo restituito del metodo RPC.

Parametri

id
Nullable<Int64>

Identificatore stabilito dal client. Se viene specificato il valore predefinito, si presuppone che sia una notifica.

targetName
String

Nome del metodo da richiamare. Non deve essere null o vuoto.

arguments
IReadOnlyList<Object>

Argomenti da passare al metodo richiamato. Devono essere serializzabili usando il IJsonRpcMessageFormatterselezionato. Se null, non vengono passati argomenti.

cancellationToken
CancellationToken

Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.

isParameterObject
Boolean

Valore che indica se il parametro deve essere passato come oggetto .

Valori restituiti

Task<TResult>

Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.

Attributi

Si applica a

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

Richiama un determinato metodo in un server 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)

Parametri di tipo

TResult

Tipo restituito del metodo RPC.

Parametri

id
RequestId

Identificatore stabilito dal client. Se viene specificato il valore predefinito, si presuppone che sia una notifica.

targetName
String

Nome del metodo da richiamare. Non deve essere null o vuoto.

arguments
IReadOnlyList<Object>

Argomenti da passare al metodo richiamato. Devono essere serializzabili usando il IJsonRpcMessageFormatterselezionato. Se null, non vengono passati argomenti.

positionalArgumentDeclaredTypes
IReadOnlyList<Type>

Elenco di oggetti Type che descrivono il modo in cui ogni elemento in arguments è previsto dal server da digitare. Se specificato, deve avere esattamente la stessa lunghezza di arguments e non contenere elementi null. Questo valore viene ignorato quando isParameterObject è true.

namedArgumentDeclaredTypes
IReadOnlyDictionary<String,Type>

Dizionario di oggetti Type che descrivono il modo in cui ogni voce della IReadOnlyDictionary<TKey,TValue> fornita nell'unico elemento di arguments è prevista dal server da digitare. Se specificato, deve avere esattamente lo stesso set di chiavi del dizionario contenuto nel primo elemento di argumentse non contenere valori null.

cancellationToken
CancellationToken

Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.

isParameterObject
Boolean

Valore che indica se il parametro deve essere passato come oggetto .

Valori restituiti

Task<TResult>

Attività che viene completata con la risposta dal server JSON-RPC.

Eccezioni

Generata dopo l'annullamento di cancellationToken. Se la richiesta è già stata trasmessa, l'eccezione viene generata solo dopo che il server ha ricevuto la notifica di annullamento e ha risposto. Se il server completa la richiesta anziché annullare, questa eccezione non verrà generata. Quando la connessione viene eliminata prima di ricevere una risposta, questa eccezione viene generata se cancellationToken è stato annullato.

Classe base comune per un'ampia gamma di eccezioni RPC che possono essere generate. Alcuni tipi derivati comuni sono elencati singolarmente.

Generata quando viene restituito un errore dal server in conseguenza dell'esecuzione del metodo richiesto.

Generata quando il server segnala che non è stato trovato alcun metodo corrispondente da richiamare.

Se targetName è Null.

Generata quando targetName è vuoto.

Se questa istanza di JsonRpc è già stata eliminata prima di questa chiamata.

Generata quando la connessione viene terminata (da uno dei due lati) prima della richiesta o mentre la richiesta è in corso, a meno che cancellationToken non sia già segnalato.

Qualsiasi eccezione generata dal IJsonRpcMessageFormatter (in genere a causa di errori di serializzazione). Quando si usa JsonMessageFormatter deve essere Newtonsoft.Json.JsonSerializationException. Quando si usa MessagePackFormatter deve essere MessagePack.MessagePackSerializationException.

Si applica a