Mentalis.org Security Library documentation

VirtualSocket.Shutdown Method 

Disables sends and receives on a VirtualSocket.

[Visual Basic]
Overridable Public Sub Shutdown( _
   ByVal how As SocketShutdown _
)
[C#]
public virtual void Shutdown(
   SocketShutdown how
);

Parameters

how
The SocketShutdown value specifying the operation that will no longer be allowed.

Remarks

Setting how to Send, specifies that subsequent calls to Send are not allowed. With TCP sockets, a FIN will be sent after all data is sent and acknowledged by the receiver.

Setting how to Receive, specifies that subsequent calls to Receive are not allowed. This has no effect on lower protocol layers. For TCP sockets, the connection is reset if data is waiting to be received or if more data arrives after the Socket is disabled. For UDP sockets, datagrams are accepted and queued.

Setting how to Both disables both sends and receives as described above.

To finish closing the Socket, a call to Close must be made after the call to Shutdown. You should not attempt to reuse the Socket.

Exceptions

Exception TypeCondition
SocketExceptionAn error occurs while closing the VirtualSocket.
ObjectDisposedExceptionThe VirtualSocket has been closed.

See Also

VirtualSocket Class | VirtualSocket Members | Org.Mentalis.Security.Ssl Namespace