Socket异步接受/发送函数 Send/ReceiveAsync在什么情况下触发完成事件
kn_c 2015-03-13 10:51:04 不考虑在开始异步前,链接关闭(否者在调用的时候会抛出异常)。
调用返回
1.FALSE 即同步完成
为什么会同步完成?是在开始调用时,已经有数据到了缓冲区?
2.TRUE 开始异步
在什么情况下compeled事件会触发?
MSDN上有段说明
For byte stream-style sockets, incoming data is placed into the buffer until the buffer is filled, the connection is closed, or the internally buffered data is exhausted.