异步I_O模型下的WebSocket Client。

下面照抄MSDN对于WSAAsyncSelect的解释:
1.The socket created by the accept function has the same properties as the listening socket used to accept it.(由listen socket 的accept返回的socket和listen的socket 具有同样的属性。意味着accept返回的socket不用再重新zc窗口消息。这给socket服务器提供了便利。)
2.When one of the nominated network events occurs on the specified socket s, the application window hWndreceives message wMsg. The wParam parameter identifies the socket on which a network event has occurred. The low word of lParam specifies the network event that has occurred. The high word of lParam contains any error code. The error code be any error as defined in Winsock2.h.(wParam标识哪一个socket发生了事件,LOWWORD(lParam)表示当前发生的是哪个事件(是接收还是发送) 而HIWORD(lParam ) 标识错误代码)
3.Although WSAAsyncSelect can be called with interest in multiple events, the application window will receive a single message for each network event。(虽然zc事件可以是同时多个事件,但是消息响应是一个一个来的。)
关于WSAAsyncSelect的一些解释:
参数“s”:A descriptor that identifies the socket for which event notification is required.(嵌套字标识符)
参数“hWnd”:A handle that identifies the window that will receive a message when a network event occurs.(接受消息的窗口句柄)
参数“wMsg”:A message to be received when a network event occurs.(事件发生时发给窗口的uMsg)
参数“lEvent”:A bitmask that specifies a combination of network events in which the application is interested.(监听的事件标识)

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系贝贝进行处理。
本站默认解压密码:www.hibbba.com