CAsyncSocket

A CAsyncSocket object represents a Windows Socket, which is an endpoint of network communication. The CAsyncSocket class encapsulates the Windows Sockets API, providing an object-oriented abstraction for programmers who want to use Windows Sockets in conjunction with MFC.

Windows CE does not support asynchronous event notification so, when writing an application for Windows CE, you should use the new CCeSocket class, instead of CAsyncSocket. The CCeSocket class enables Windows CE applications to send and receive socket notifications for certain asynchronous events.

At a Glance

Header file: Afxsock.h
Platforms:
Versions: 2.0 and later
Complete documentation Visual C++ documentation

Remarks

MFC for Windows CE does not fully support asynchronous event notification, so it does not support the AsyncSelect member function of the CAsyncSocket class. It also does not support the lEvent parameter of the CAsyncSocket::Attach member function. The new CCeSocket class does support asynchronous notification for certain socket events.

You should always use the new CCeSocket class, instead of CAsyncSocket, when writing applications for Windows CE.

MFC for Windows CE does not support the GetLastError member function of the CAsyncSocket class. Use the global ::GetLastError function instead.

See Also

CAsyncSocket Member Functions, CAsyncSocket Data Members, Windows Sockets Classes, CAsyncSocket::Attach, CCeSocket, CSocket, ::GetLastError