Socket I/O mode epoll,overlapped I/O

隐身守侯 提交于 2019-12-05 07:00:20

问题


I am working client server application where I need to manage multiple socket connection 1000+.

By exploration I found out the Overlapped I/O or Completion Port is nice to do de-multiplexing multiple socket in Windows and epoll is nice on Linux.

  1. Is epoll is different from Overlapped I/O or Completion Port in windows.
  2. I wanted to use boost since it works on both windows and Linux.

Is it possible to implement these techniques (epoll and Overlapped I/O or Completion Port) using boost?


回答1:


The implementation of epoll on Linux and I/O completion ports on Windows are different, however Boost.Asio nicely abstracts away the differences for your application. This is the whole point of the io_service reactor queue:

Windows NT, 2000, XP, 2003 and Vista

Demultiplexing mechanism:

  • Uses overlapped I/O and I/O completion ports for all asynchronous socket operations except for asynchronous connect.
  • Uses select for emulating asynchronous connect.

Linux Kernel 2.6

Demultiplexing mechanism:

  • Uses epoll for demultiplexing.


来源:https://stackoverflow.com/questions/5431639/socket-i-o-mode-epoll-overlapped-i-o

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!