Mono Class Library: System.Net.Sockets.NetworkStream Overview | Members

System.Net.Sockets.NetworkStream Constructor

Constructs and initializes a new instance of the System.Net.Sockets.NetworkStream class. [Edit]

public NetworkStream (Socket socket, System.IO.FileAccess access, bool owns_socket)

Parameters

socket
An instance of the System.Net.Sockets.Socket class. [Edit]
access
One of the values of the System.IO.FileAccess enumeration. [Edit]
owns_socket
Documentation for this section has not yet been entered. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionsocket is null. [Edit]
System.IO.IOException

The Socket.Blocking property of socket is false.

-or-

The Socket.Connected property of socket is false.

-or-

The Socket.SocketType property of socket is not SocketType.Stream.

[Edit]

Remarks

socket is required to be an instance of the System.Net.Sockets.Socket class with its Socket.Connected property equal to true , Socket.Blocking property equal to true , and System.Net.Sockets.SocketType equal to SocketType.Stream.

When ownsSocket is true, the current instance owns socket, meaning the NetworkStream.Close and NetworkStream.Dispose(bool) methods call the Socket.Close method of socket.

[Edit]

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0