CAsyncSocket::Close

virtual void Close( );

Remarks

This function closes the socket. More precisely, it releases the socket descriptor, so that further references to it will fail with the error WSAENOTSOCK. If this is the last reference to the underlying socket, the associated naming information and queued data are discarded. The socket object’s destructor calls Close for you.

For CAsyncSocket, but not for CSocket, the semantics of Close are affected by the socket options SO_LINGER and SO_DONTLINGER. For further information, see member function GetSockOpt and Overview of Windows Sockets 2 and Windows Sockets Programming Considerations in the Win32 SDK documentation.

CAsyncSocket OverviewClass MembersHierarchy Chart

See Also   CAsyncSocket::Accept, CAsyncSocket::CAsyncSocket, CAsyncSocket::IOCtl, CAsyncSocket::GetSockOpt, CAsyncSocket::SetSockOpt, CAsyncSocket::AsyncSelect