MFC for Windows CE supports a global function and a window message that you can use in conjunction with the CCeSocket class. Windows CE does not support asynchronous event notification. Although CCeSocket simulates asynchronous notifications, you may sometimes need to directly send messages to the window used by the by a CCeSocket object.
Use the WM_SOCKET_NOTIFY message in a Windows CE application to notify a socket of an asynchronous event, for example, when the socket to which it is connected is closing.
The WM_SOCKET_NOTIFY message is processed by a socket window that is maintained as part of the module’s thread state. Use the AfxGetCeSocketWindow function to obtain the handle to this window.
For an example of how to use AfxGetCeSocketWindow and WM_SOCKET_NOTIFY in a Windows CE socket application, see the CHATTER/CHATSRVR sample application.