HttpListener.GetContextAsync Metodo

Definizione

Attende una richiesta in ingresso come operazione asincrona.

public:
 System::Threading::Tasks::Task<System::Net::HttpListenerContext ^> ^ GetContextAsync();
public System.Threading.Tasks.Task<System.Net.HttpListenerContext> GetContextAsync ();
member this.GetContextAsync : unit -> System.Threading.Tasks.Task<System.Net.HttpListenerContext>
Public Function GetContextAsync () As Task(Of HttpListenerContext)

Restituisce

Task<HttpListenerContext>

Oggetto dell'attività che rappresenta l'operazione asincrona. La proprietà Result nell'oggetto attività restituisce un oggetto HttpListenerContext che rappresenta una richiesta del client.

Commenti

Questa operazione non verrà bloccata. L'oggetto restituito verrà completato quando la richiesta in ingresso è stata ricevuta Task<TResult> .

Prima di chiamare questo metodo, è necessario chiamare il Start metodo e aggiungere almeno un prefisso URI per l'ascolto aggiungendo le stringhe URI all'oggetto HttpListenerPrefixCollection restituito dalla Prefixes proprietà . Per una descrizione dettagliata dei prefissi, vedere la panoramica della HttpListener classe.

Si applica a

Vedi anche