SslStream.WriteTimeout プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SslStream.WriteTimeout プロパティの意味・解説 

SslStream.WriteTimeout プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

書き込み操作ブロックしてデータ待機する時間取得または設定します

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

Public Overrides Property
 WriteTimeout As Integer
Dim instance As SslStream
Dim value As Integer

value = instance.WriteTimeout

instance.WriteTimeout = value
public override int WriteTimeout { get;
 set; }
/** @property */
public int get_WriteTimeout ()

/** @property */
public void set_WriteTimeout (int
 value)

プロパティ
同期書き込み操作失敗するまでの時間指定する Int32。

解説解説

このプロパティは、基になるストリームの WriteTimeout を呼び出すことによって返される値を返します設定操作では、指定した値によって基になるストリームWriteTimeout 値が設定されます。

基になるストリームが NetworkStream の場合WriteTimeoutミリ秒単位です。また、書き込み操作タイムアウトないように、既定では Infinite設定されます。

使用例使用例

このプロパティの値を設定するコード例次に示します

static void ProcessClient (TcpClient client)
{
    // A client has connected. Create the 
    // SslStream using the client's network stream.
    SslStream sslStream = new SslStream(
        client.GetStream(), false);
    // Authenticate the server but don't require the client to authenticate.
    try 
    {
        sslStream.AuthenticateAsServer(serverCertificate, 
            false, SslProtocols.Tls, true);
        // Display the properties and settings for the authenticated
 stream.
        DisplaySecurityLevel(sslStream);
        DisplaySecurityServices(sslStream);
        DisplayCertificateInformation(sslStream);
        DisplayStreamProperties(sslStream);

        // Set timeouts for the read and write to 5 seconds.
        sslStream.ReadTimeout = 5000;
        sslStream.WriteTimeout = 5000;
        // Read a message from the client.   
        Console.WriteLine("Waiting for client message...");
        string messageData = ReadMessage(sslStream);
        Console.WriteLine("Received: {0}", messageData);
        
        // Write a message to the client.
        byte[] message = Encoding.UTF8.GetBytes("Hello from the server.<EOF>");
        Console.WriteLine("Sending hello message.");
        sslStream.Write(message);
    }
    catch (AuthenticationException e)
    {
        Console.WriteLine("Exception: {0}", e.Message);
        if (e.InnerException != null)
        {
            Console.WriteLine("Inner exception: {0}", e.InnerException.Message);
        }
        Console.WriteLine ("Authentication failed - closing the connection.");
        sslStream.Close();
        client.Close();
        return;
    }
    finally
    {
        // The client stream will be closed with the sslStream
        // because we specified this behavior when creating
        // the sslStream.
        sslStream.Close();
        client.Close();
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SslStream クラス
SslStream メンバ
System.Net.Security 名前空間



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

辞書ショートカット

すべての辞書の索引

「SslStream.WriteTimeout プロパティ」の関連用語

SslStream.WriteTimeout プロパティのお隣キーワード
検索ランキング

   

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



SslStream.WriteTimeout プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS