IOCP Server: General Declaration And Summary
2014-04-03 17:16
148 查看
General Declaration:
There are 5 kinds of network I/O model for windows system: (1) Select, (2) WSAAsyncSelect, (3) WSAEventSelect, (4) Overlapped I/O, (5) Completion Port. Each of them could be used on different occasions.
As for SELECT, the most common network I/O model, the majoy method is how to grasp the use of select function to manage network I/O. In detail, how to use it to judge whether there is data to read in or write to, whether we can write data into a socket,
to prevent program locked when the socket is blocked at an I/O calling process (such as send, recv, accept, etc), so that the error "WSAEWOULDBLOCK" occurred.
As for WSAASYNCSELECT, it's an effective network I/O model. The application can receive a network event notification based on windows messages. In detail, we call WSAAsyncSelect function after a window socket created. The majoy point is how to use WSAAsyncSelect
function.
As for WSAEVENTSELECT, it's another effective asynchronous network I/O model. Similar to WSAASYNCSELECT, this model also allowed application receive network event notifications based on windows messages. However, the most important difference is, the
network event will be posted to an event handle, but not a window procedure.
As for Overlapped I/O, it's more effective than above because of the use with overlapped data structure, WSAOVERLAPPED, so that it could post many sockets once. The application will process all after receive the notification.
The most difficult and effective network I/O model is COMPLETION PORT. To use completion port, windows system version should be windows NT or windows 2000 and above. Completion port could process hundreds of socket at one time.
Summary:
There are 5 kinds of network I/O model for windows system: (1) Select, (2) WSAAsyncSelect, (3) WSAEventSelect, (4) Overlapped I/O, (5) Completion Port. Each of them could be used on different occasions.
As for SELECT, the most common network I/O model, the majoy method is how to grasp the use of select function to manage network I/O. In detail, how to use it to judge whether there is data to read in or write to, whether we can write data into a socket,
to prevent program locked when the socket is blocked at an I/O calling process (such as send, recv, accept, etc), so that the error "WSAEWOULDBLOCK" occurred.
As for WSAASYNCSELECT, it's an effective network I/O model. The application can receive a network event notification based on windows messages. In detail, we call WSAAsyncSelect function after a window socket created. The majoy point is how to use WSAAsyncSelect
function.
As for WSAEVENTSELECT, it's another effective asynchronous network I/O model. Similar to WSAASYNCSELECT, this model also allowed application receive network event notifications based on windows messages. However, the most important difference is, the
network event will be posted to an event handle, but not a window procedure.
As for Overlapped I/O, it's more effective than above because of the use with overlapped data structure, WSAOVERLAPPED, so that it could post many sockets once. The application will process all after receive the notification.
The most difficult and effective network I/O model is COMPLETION PORT. To use completion port, windows system version should be windows NT or windows 2000 and above. Completion port could process hundreds of socket at one time.
Summary:
相关文章推荐
- IOCP浅析[二]——IOCP出现的意义和函数接口
- IOCP 简单实例
- IOCP配合AcceptEx的例子
- IOCP中的AcceptEx
- 谈谈IOCP发送数据时的一些误区及技巧
- IOCP相关的一些总结
- 高性能服务器底层网络通信模块的设计方法
- IOCP模型的总结
- [网络开发]IOCP完整例子
- IOCP学习理解一
- S_OK,S_FALSE,E_FAIL
- 套接字I/O模型-完成端口IOCP
- _WIN32_WINNT 与 LPFN_DISCONNECTEX
- IOCP SOCKET池的实现
- IOCP
- 对IOCP的一点个人理解
- 高性能 Windows Socket 组件 HP-Socket v2.2.3 正式发布
- 高性能 Windows Socket 组件 HP-Socket v2.3.1-beta-1 发布
- 高性能 Windows Socket 组件 HP-Socket v3.0.2 正式发布
- WCF热门问题编程示例(3):WCF是否使用或者支持IOCP完成端口(整理补充)