CCeSocket

CCeSocket

0 out of 1 rated this helpful Rate this topic

This class is derived from the CSocket class. If you want to use asynchronous communication in Windows CE, you must use the CCeSocket class. Windows CE does not inherently support asynchronous socket communication, but the CCeSocket class provides asynchronous notification for the following types of socket events:

  • Notification that the socket is ready to read (FD_READ)
  • Notification of incoming connections (FD_ACCEPT)
  • Notification of completed connections (FD_CONNECT)
Remarks

Use the CCeSocket class, or a class derived from CCeSocket, for Windows CE applications, rather than using CSocket or CAsyncSocket.

The CSocket and CAsyncSocket classes rely on the standard Windows message-based notification of network events, but Windows CE does not support asynchronous event notification. Without access to asynchronous event notification, an application must poll for network events that it wishes to handle. This is inefficient. The CCeSocket class achieves the effect of asynchronous event notification by creating two threads that monitor socket events. When a thread detects one of the three events for which the CCeSocket class provides notifications, it sends a message to the appropriate handler. All instances of CCeSocket share the same two monitor threads.

MFC for Windows CE supports a global function and a window message that you can use in conjunction with the CCeSocket class. 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 thread state of the module. Use the AfxGetCeSocketWindow function to obtain the handle to this window.

Requirements

  Windows CE versions: 2.0 and later
  Header file: Declared in Wcesock.h
  Platform: H/PC Pro, Palm-size PC, Pocket PC

See Also

CArchiveCAsyncSocketCSocketFileUnique MFC Classes for Windows CE

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值