[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Disables sends and receives on a Socket.
Assembly: System.Net (in System.Net.dll)
Public Sub Shutdown ( _ how As SocketShutdown _ )
public void Shutdown( SocketShutdown how )
One of the SocketShutdown values that specifies the operation that will no longer be allowed.
An error occurred when attempting to access the socket. See the Remarks section for more information.
The Socket has been closed.
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 ReceiveAsync are not allowed. This has no effect on lower protocol layers. For a connection-oriented protocol, the connection is terminated if either of the following conditions exist after a call to Shutdown :
Data is in the incoming network buffer waiting to be received.
More data has arrived.
Setting how to Both disables both sends and receives as described above.
If you receive a SocketException when calling this 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.
Windows Phone OS
Supported in: 8.1, 8.0, 7.1