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

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


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

static void ReadCallback(IAsyncResult ar) { // Read the message sent by the server. // The end of the message is signaled using the // "<EOF>" marker. SslStream stream = (SslStream) ar.AsyncState; int byteCount = -1; try { Console.WriteLine("Reading data from the server."); byteCount = stream.EndRead(ar); // Use Decoder class to convert from bytes to UTF8 // in case a character spans two buffers. Decoder decoder = Encoding.UTF8.GetDecoder(); char[] chars = new char[decoder.GetCharCount(buffer,0, byteCount)]; decoder.GetChars(buffer, 0, byteCount, chars,0); readData.Append (chars); // Check for EOF or an empty message. if (readData.ToString().IndexOf("<EOF>") == -1 && byteCount != 0) { // We are not finished reading. // Asynchronously read more message data from the server. stream.BeginRead(buffer, 0, buffer.Length, new AsyncCallback(ReadCallback), stream); } else { Console.WriteLine("Message from the server: {0}", readData.ToString()); } } catch (Exception readException) { e = readException; complete = true; return; } complete = true; }

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に収録されているすべての辞書からSslStream.EndRead メソッドを検索する場合は、下記のリンクをクリックしてください。

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