Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function initiates termination of the connection for the socket and sends disconnect data.

Note:
WSPSendDisconnectis not supported for the default TCP/UDP provider in Windows Embedded CE. However, third parties can implement their own provider and have support for this function if they choose.

Syntax

int WSPSendDisconnect(
  SOCKET 
s,
  LPWSABUF 
lpOutboundDisconnectData,
  LPINT 
lpErrno 
);

Parameters

s

[in] A descriptor identifying a socket.

lpOutboundDisconnectData

[in] A pointer to the outgoing disconnect data.

lpErrno

[out] A pointer to the error code.

Return Value

This function always returns SOCKET_ERROR and sets lpErrnoto WSASYSCALLFAILURE on Windows Embedded CE.

Remarks

This function is used on connection-oriented sockets to disable transmission, and to initiate termination of the connection along with the transmission of disconnect data, if any.

After this function has been successfully issued, subsequent sends are disallowed.

lpOutboundDisconnectData, if not NULL, points to a buffer containing the outgoing disconnect data to be sent to the remote party.

Note:
WSPSendDisconnectdoes not close the socket, and that resources attached to the socket will not be freed until WSPCloseSocketis invoked.
Note:
WSPSendDisconnectdoes not block regardless of the SO_LINGERsetting on the socket.
Note:
A Windows Sockets SPI client should not rely on being able to reuse a socket after it has been disconnected. In particular, a Windows Sockets provider is not required to support the use of WSPConnecton such a socket.

Requirements

Header ws2spi.h
Library Ws2.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

WSPConnect
WSPSocket