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

Public Overrides Function BeginWrite ( _ buffer As Byte(), _ offset As Integer, _ count As Integer, _ asyncCallback As AsyncCallback, _ asyncState As Object _ ) As IAsyncResult
Dim instance As SslStream Dim buffer As Byte() Dim offset As Integer Dim count As Integer Dim asyncCallback As AsyncCallback Dim asyncState As Object Dim returnValue As IAsyncResult returnValue = instance.BeginWrite(buffer, offset, count, asyncCallback, asyncState)
public override IAsyncResult BeginWrite ( byte[] buffer, int offset, int count, AsyncCallback asyncCallback, Object asyncState )
public: virtual IAsyncResult^ BeginWrite ( array<unsigned char>^ buffer, int offset, int count, AsyncCallback^ asyncCallback, Object^ asyncState ) override
public IAsyncResult BeginWrite ( byte[] buffer, int offset, int count, AsyncCallback asyncCallback, Object asyncState )
public override function BeginWrite ( buffer : byte[], offset : int, count : int, asyncCallback : AsyncCallback, asyncState : Object ) : IAsyncResult
戻り値
非同期操作のステータスを示す IAsyncResult オブジェクト。


void ReadCallback(IAsyncResult ar) { ClientState state = (ClientState) ar.AsyncState; SslStream stream = state.stream; // Read the message sent by the client. // The end of the message is signaled using the // "<EOF>" marker. int byteCount = -1; try { Console.WriteLine("Reading data from the client."); 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(state.buffer,0, byteCount)]; decoder.GetChars(state.buffer, 0, byteCount, chars,0); state.readData.Append (chars); // Check for EOF or an empty message. if (state.readData.ToString().IndexOf("<EOF>") == -1 && byteCount != 0) { // We are not finished reading. // Asynchronously read more message data from the client. stream.BeginRead(state.buffer, 0, state.buffer.Length, new AsyncCallback(ReadCallback), state); } else { Console.WriteLine("Message from the client: {0}", state.readData.ToString()); } // Encode a test message into a byte array. // Signal the end of the message using "<EOF>". byte[] message = Encoding.UTF8.GetBytes("Hello from the server.<EOF>"); // Asynchronously send the message to the client. stream.BeginWrite(message, 0, message.Length, new AsyncCallback(WriteCallback), state); } catch (Exception readException) { Console.WriteLine("Read error: {0}", readException.Message); state.Close(); return; } }

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.BeginWrite メソッドを検索する場合は、下記のリンクをクリックしてください。

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