Socket::Shutdown Method (SocketShutdown)
Disables sends and receives on a Socket.
Assembly: System (in System.dll)
The following table shows the SocketShutdown enumeration values that are valid for the how parameter.
Disable sending on this Socket.
Disable receiving on this Socket.
Disable both sending and receiving on this Socket.
Setting how to Receive specifies that subsequent calls to Receive are not allowed. This has no effect on lower protocol layers. If you are using a connection-oriented protocol, the connection is terminated if either of the following conditions exist after a call to :
Data is in the incoming network buffer waiting to be received.
More data has arrived.
If you are using a connectionless protocol, datagrams are accepted and queued. However, if no buffer space is available for additional incoming datagrams, they will be discarded and no error will be returned to the sender. Using Socket is not recommended.on a connectionless
Setting how to Both disables both sends and receives as described above.
If you receive a SocketException when calling the method, use the SocketException::ErrorCode property to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation in the MSDN library for a detailed description of the error.
This member outputs trace information when you enable network tracing in your application. For more information, see Network Tracing in the .NET Framework.
Available since 10
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.1