From 83d630007c89be5539804594cac8c60e319e3864 Mon Sep 17 00:00:00 2001 From: PioLing <964472638@qq.com> Date: Fri, 17 May 2024 11:12:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20Win32=20Select=20=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E5=BC=8F=E4=B8=8D=E9=99=90=E5=88=B6=20socket=20fd=20(?= =?UTF-8?q?#228)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Poller/EventPoller.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Poller/EventPoller.cpp b/src/Poller/EventPoller.cpp index 45ef73be..ddd18c7f 100644 --- a/src/Poller/EventPoller.cpp +++ b/src/Poller/EventPoller.cpp @@ -140,10 +140,13 @@ int EventPoller::addEvent(int fd, int event, PollEventCB cb) { } return ret; #else +#ifndef _WIN32 + // win32平台,socket套接字不等于文件描述符,所以可能不适用这个限制 if (fd >= FD_SETSIZE) { WarnL << "select() can not watch fd bigger than " << FD_SETSIZE; return -1; } +#endif auto record = std::make_shared(); record->fd = fd; record->event = event;