NegotiateStream.EndRead メソッド
アセンブリ: System (system.dll 内)

Dim instance As NegotiateStream Dim asyncResult As IAsyncResult Dim returnValue As Integer returnValue = instance.EndRead(asyncResult)
戻り値
基になるストリームから読み取るバイト数を指定する Int32 値。


操作が完了していない場合、このメソッドは操作が完了するまでブロックします。
この操作を同期で実行するには、Read メソッドを使用します。
このメソッドは、正常に認証されるまで呼び出すことはできません。認証するには、AuthenticateAsClient、BeginAuthenticateAsClient、AuthenticateAsServer、または BeginAuthenticateAsServer のいずれかのメソッドを呼び出します。

非同期読み取り操作を終了するコード例を次に示します。操作を開始する例については、BeginRead のトピックを参照してください。
public static void EndReadCallback(IAsyncResult ar) { // Get the saved data. ClientState cState = (ClientState) ar.AsyncState; TcpClient clientRequest = cState.Client; NegotiateStream authStream = (NegotiateStream) cState.AuthenticatedStream; // Get the buffer that stores the message sent by the client. int bytes = -1; // Read the client message. try { bytes = authStream.EndRead(ar); cState.Message.Append(Encoding.UTF8.GetChars(cState.Buffer, 0, bytes)); if (bytes != 0) { authStream.BeginRead(cState.Buffer, 0, cState.Buffer.Length, new AsyncCallback(EndReadCallback), cState); return; } } catch (Exception e) { // A real application should do something // useful here, such as logging the failure. Console.WriteLine("Client message exception:"); Console.WriteLine(e); cState.Waiter.Set(); return; } IIdentity id = authStream.RemoteIdentity; Console.WriteLine("{0} says {1}", id.Name, cState.Message.ToString()); cState.Waiter.Set(); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からNegotiateStream.EndRead メソッドを検索する場合は、下記のリンクをクリックしてください。

- NegotiateStream.EndRead メソッドのページへのリンク