HttpListener.EndGetContext メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HttpListener.EndGetContext メソッドの意味・解説 

HttpListener.EndGetContext メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

受信クライアント要求取得する非同期操作完了します

名前空間: System.Net
アセンブリ: System (system.dll 内)
構文構文

Public Function EndGetContext ( _
    asyncResult As IAsyncResult _
) As HttpListenerContext
Dim instance As HttpListener
Dim asyncResult As IAsyncResult
Dim returnValue As HttpListenerContext

returnValue = instance.EndGetContext(asyncResult)
public HttpListenerContext EndGetContext (
    IAsyncResult asyncResult
)
public:
HttpListenerContext^ EndGetContext (
    IAsyncResult^ asyncResult
)
public HttpListenerContext EndGetContext (
    IAsyncResult asyncResult
)
public function EndGetContext (
    asyncResult : IAsyncResult
) : HttpListenerContext

パラメータ

asyncResult

非同期操作開始時に取得した IAsyncResult オブジェクト

戻り値
クライアント要求を表す HttpListenerContext オブジェクト

例外例外
例外種類条件

ArgumentException

asyncResult を BeginGetContext の呼び出し取得できませんでした

ArgumentNullException

asyncResultnull 参照 (Visual Basic では Nothing) です。

InvalidOperationException

EndGetContext メソッドは、既に指定されasyncResult オブジェクトに対して呼び出されています。

ObjectDisposedException

オブジェクト閉じてます。

解説解説
使用例使用例

EndGetContext メソッド呼び出すコールバック メソッド実装コード例次に示します

public static void ListenerCallback(IAsyncResult
 result)
{
    HttpListener listener = (HttpListener) result.AsyncState;
    // Call EndGetContext to complete the asynchronous operation.
    HttpListenerContext context = listener.EndGetContext(result);
    HttpListenerRequest request = context.Request;
    // Obtain a response object.
    HttpListenerResponse response = context.Response;
    // Construct a response.
    string responseString = "<HTML><BODY> Hello
 world!</BODY></HTML>";
    byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
    // Get a response stream and write the response to it.
    response.ContentLength64 = buffer.Length;
    System.IO.Stream output = response.OutputStream;
    output.Write(buffer,0,buffer.Length);
    // You must close the output stream.
    output.Close();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からHttpListener.EndGetContext メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHttpListener.EndGetContext メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHttpListener.EndGetContext メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

HttpListener.EndGetContext メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HttpListener.EndGetContext メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS