|
发表于 2009-7-15 13:01:56
|
显示全部楼层
第一个问题可以参考C++NPV2
WRITE_MASK semantics different from select(). When a socket can send more data, select() detects a WRITE condition. It will continue to detect this condition as long as the socket remains writeable, that is, until it becomes flow controlled. In contrast, the Windows WSAEventSelect() function only sets the WRITE event when the socket is first connected, whether passively or actively, and when the socket transitions from flow-controlled to writeable. When relying on WRITE events using the ACE_WFMO_Reactor, you must therefore continue to write until the connection closes or the socket becomes flow controlled and a send() fails with EWOULDBLOCK. If this behavior is undesirable, you might consider choosing the ACE_Select_Reactor as the ACE_Reactor implementation on Windows since it has the same WRITE_MASK semantics as on UNIX platforms.
第二个问题,楼主所谓的策略模式是什么?notification_strategy?
如果是这个的话,可以参考C++NPV2的第3,4章,也可以参考下面的帖子。
http://www.acejoy.com/bbs/viewth ... &extra=page%3D1。
我个人也比较赞同帖子的部分观点,这个通知机制中包含了不少小陷阱,
想用对通知机制恐怕得需要花费楼主你不少时间,
如果仅在windows下开发的,有很多替代的办法,不建议使用通知机制。 |
|