Share via


shutdown

This function disables send or receive operations on a socket. It does not release any system resources used by the socket.

int shutdown (
SOCKET s, 
int how ); 

Parameters

  • s
    [in] Descriptor that identifies a socket.
  • how
    [in] Flag that describes what types of operation will no longer be allowed.

Return Values

Zero indicates that no error occurred. SOCKET_ERROR indicates failure. To get a specific error value, call WSAGetLastError.

Remarks

The shutdown function is used on all types of sockets to disable reception, transmission, or both.

The shutdown function does not close the socket. Any resources attached to the socket will not be freed until closesocket is invoked.

Note   The shutdown function does not block regardless of the SO_LINGER setting on the socket.

An application should not rely on being able to re-use a socket after it has been shut down. In particular, a Windows Sockets provider is not required to support the use of connect on a socket that has been shutdown.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winsock.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

closesocket, connect, socket, WSAStartup

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.