Switch socket management API to epoll() (#7785)
authorGabriel Braga <gabriel.braga@intra2net.com>
Tue, 9 Apr 2024 14:48:19 +0000 (16:48 +0200)
committerGabriel Braga <gabriel.braga@intra2net.com>
Tue, 9 Apr 2024 15:17:44 +0000 (17:17 +0200)
commit219c71d489d9ed1de6a5232f96f7f8a299e57d15
treebab9921ced8a224de942c03132e5887f7bbd4648
parent0a531de652b3c0d1f3d7810f4f772d37b64c8a10
Switch socket management API to epoll() (#7785)

Previously all the server and client sockets were being managed by
the select() API, which operates using a fixed amount of client
sockets. This commit changes the code to adapt to the epoll() API.
This commit also could have a performance improvement due to epoll's
architecture.

Note: next commits should fix:
- The clock from sec to millisecs as the epoll_wait()
uses millisecs.
- Unit tests need to be changed to work properly.
20 files changed:
src/client_wrapper.hxx
src/command_client.cpp
src/command_client.hxx
src/command_server.cpp
src/command_server.hxx
src/connection.hxx
src/server.cpp
src/server.hxx
src/socket_client.cpp
src/socket_client.hxx
src/socket_handler.cpp
src/socket_handler.hxx
src/socket_server.cpp
src/socket_server.hxx
src/socket_wrapper.cpp
src/socket_wrapper.hxx
test/hello.cpp
test/reentrant.cpp
test/timeout.cpp
test/wrapper.cpp