NegotiateStream.WriteTimeout 속성

정의

쓰기 작업에서 데이터 대기를 차단하는 시간을 가져오거나 설정합니다.

public:
 virtual property int WriteTimeout { int get(); void set(int value); };
public override int WriteTimeout { get; set; }
member this.WriteTimeout : int with get, set
Public Overrides Property WriteTimeout As Integer

속성 값

쓰기 작업이 실패할 때까지 걸리는 시간을 지정하는 Int32입니다.

예제

다음 코드 예제에서는이 속성의 값을 표시 합니다.

static void DisplayStreamProperties( NegotiateStream^ stream )
{
   Console::WriteLine( L"Can read: {0}", stream->CanRead );
   Console::WriteLine( L"Can write: {0}", stream->CanWrite );
   Console::WriteLine( L"Can seek: {0}", stream->CanSeek );
   try
   {
      
      // If the underlying stream supports it, display the length.
      Console::WriteLine( L"Length: {0}", stream->Length );
   }
   catch ( NotSupportedException^ ) 
   {
      Console::WriteLine( L"Cannot get the length of the underlying stream." );
   }

   if ( stream->CanTimeout )
   {
      Console::WriteLine( L"Read time-out: {0}", stream->ReadTimeout );
      Console::WriteLine( L"Write time-out: {0}", stream->WriteTimeout );
   }
}


 static void DisplayStreamProperties(NegotiateStream stream)
{
     Console.WriteLine("Can read: {0}", stream.CanRead);
     Console.WriteLine("Can write: {0}", stream.CanWrite);
     Console.WriteLine("Can seek: {0}", stream.CanSeek);
     try
     {
         // If the underlying stream supports it, display the length.
         Console.WriteLine("Length: {0}", stream.Length);
     } catch (NotSupportedException)
     {
             Console.WriteLine("Cannot get the length of the underlying stream.");
     }

     if (stream.CanTimeout)
     {
         Console.WriteLine("Read time-out: {0}", stream.ReadTimeout);
         Console.WriteLine("Write time-out: {0}", stream.WriteTimeout);
     }
}

설명

이 속성은 기본 스트림에서 속성을 호출하여 WriteTimeout 반환되는 값을 반환합니다. 설정 작업의 경우 지정된 값은 기본 스트림의 WriteTimeout 값을 설정합니다.

기본 스트림이 인 NetworkStreamWriteTimeout 경우 는 밀리초 단위이며 쓰기 작업이 시간 초과되지 않도록 기본적으로 로 설정 Infinite 됩니다.

적용 대상