示例#1
0
 /// <summary>Create a new ouput stream with the given timeout.</summary>
 /// <remarks>
 /// Create a new ouput stream with the given timeout. If the timeout
 /// is zero, it will be treated as infinite timeout. The socket's
 /// channel will be configured to be non-blocking.
 /// </remarks>
 /// <param name="channel">
 ///
 /// Channel for writing, should also be a
 /// <see cref="SelectableChannel"/>
 /// .
 /// The channel will be configured to be non-blocking.
 /// </param>
 /// <param name="timeout">timeout in milliseconds. must not be negative.</param>
 /// <exception cref="System.IO.IOException"/>
 public SocketOutputStream(WritableByteChannel channel, long timeout)
 {
     SocketIOWithTimeout.CheckChannelValidity(channel);
     writer = new SocketOutputStream.Writer(channel, timeout);
 }
示例#2
0
 /// <summary>Create a new input stream with the given timeout.</summary>
 /// <remarks>
 /// Create a new input stream with the given timeout. If the timeout
 /// is zero, it will be treated as infinite timeout. The socket's
 /// channel will be configured to be non-blocking.
 /// </remarks>
 /// <param name="channel">
 ///
 /// Channel for reading, should also be a
 /// <see cref="SelectableChannel"/>
 /// .
 /// The channel will be configured to be non-blocking.
 /// </param>
 /// <param name="timeout">timeout in milliseconds. must not be negative.</param>
 /// <exception cref="System.IO.IOException"/>
 public SocketInputStream(ReadableByteChannel channel, long timeout)
 {
     SocketIOWithTimeout.CheckChannelValidity(channel);
     reader = new SocketInputStream.Reader(channel, timeout);
 }