net: add Linux epoll fdwatch backend
This commit is contained in:
@@ -297,7 +297,11 @@ void TestFdwatchBackendMetadata()
|
||||
LPFDWATCH fdw = fdwatch_new(4096);
|
||||
Expect(fdw != nullptr, "fdwatch_new for backend metadata failed");
|
||||
|
||||
#ifdef __USE_SELECT__
|
||||
#ifdef __linux__
|
||||
Expect(fdwatch_get_backend(fdw) == FDWATCH_BACKEND_EPOLL, "Expected epoll backend");
|
||||
Expect(std::strcmp(fdwatch_backend_name(fdwatch_get_backend(fdw)), "epoll") == 0, "Unexpected epoll backend name");
|
||||
Expect(fdwatch_get_descriptor_limit(fdw) == 4096, "Unexpected epoll descriptor limit");
|
||||
#elif defined(__USE_SELECT__)
|
||||
Expect(fdwatch_get_backend(fdw) == FDWATCH_BACKEND_SELECT, "Expected select backend");
|
||||
Expect(std::strcmp(fdwatch_backend_name(fdwatch_get_backend(fdw)), "select") == 0, "Unexpected select backend name");
|
||||
Expect(fdwatch_get_descriptor_limit(fdw) == std::min(4096, static_cast<int>(FD_SETSIZE)), "Unexpected select descriptor limit");
|
||||
|
||||
Reference in New Issue
Block a user