Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 epoll 开发了一个服务器。它在 Linux 下运行良好。但我想使用 kqueue 为 macosx 提供支持。我听说 libevent 是这些基于事件的库(epoll、kqueue)之上的抽象层。
如何使用 epoll 将此代码移植到 libevent?示例代码:https ://banu.com/blog/2/how-to-use-epoll-a-complete-example-in-c/epoll-example.c是否可能(兼容 %100)?
是的,可以更改部分代码以使用 libevent 而不是 epoll。不过,您必须阅读 libevent 文档才能准确了解您必须做什么。