Mentalis.org Security Library documentation

SecureNetworkStream Constructor (SecureSocket, FileAccess, Boolean)

Creates a new instance of the SecureNetworkStream class for the specified SecureSocket.

[Visual Basic]
Overloads Public Sub New( _
   ByVal socket As SecureSocket, _
   ByVal access As FileAccess, _
   ByVal ownsSocket As Boolean _
)
[C#]
public SecureNetworkStream(
   SecureSocket socket,
   FileAccess access,
   bool ownsSocket
);

Parameters

socket
The SecureSocket that provides the network data.
access
One of the FileAccess values that sets the CanRead and CanWrite properties of the SecureNetworkStream.
ownsSocket
true if the socket will be owned by this SecureNetworkStream instance; otherwise, false.

Exceptions

Exception TypeCondition
ArgumentNullExceptionsocket is a null reference (Nothing in Visual Basic).
ArgumentExceptionsocket is not connected -or- the SocketType property of socket is not SocketType.Stream.
IOExceptionsocket is a nonblocking socket.

See Also

SecureNetworkStream Class | SecureNetworkStream Members | Org.Mentalis.Security.Ssl Namespace | SecureNetworkStream Constructor Overload List