Loading src/event/kqueue.cpp +2 −9 Changes for src/event/kqueue.cpp: 2 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -133,9 +133,9 @@ namespace netplus { }; int getEventFlags(int pos) { if (_Events[pos].flags & EV_ERROR) { if (_Events[pos].flags & (EV_ERROR | EV_EOF)) { NetException e; e[NetException::Error] << "getEventFlags: Unrecoverable I/O error detected."; e[NetException::Note] << "getEventFlags: I/O error or connection closed by peer."; throw e; } return _Events[pos].filter; Loading Loading @@ -387,13 +387,6 @@ public: // 2. Retrieve event flags (may throw on EV_ERROR) events = pollptr.getEventFlags(i); // 3. 🚨 NEW: Handle EV_EOF (Graceful Connection Close/Hangup) // If EV_EOF is set, close the connection and skip other handlers. if (events & EV_EOF) { pollptr.CloseEventHandler(i, tid, args); continue; } // 4. Prioritize read events (new data from client) if (events & EVFILT_READ) { pollptr.ReadEventHandler(i, tid, args); Loading Loading
src/event/kqueue.cpp +2 −9 Changes for src/event/kqueue.cpp: 2 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -133,9 +133,9 @@ namespace netplus { }; int getEventFlags(int pos) { if (_Events[pos].flags & EV_ERROR) { if (_Events[pos].flags & (EV_ERROR | EV_EOF)) { NetException e; e[NetException::Error] << "getEventFlags: Unrecoverable I/O error detected."; e[NetException::Note] << "getEventFlags: I/O error or connection closed by peer."; throw e; } return _Events[pos].filter; Loading Loading @@ -387,13 +387,6 @@ public: // 2. Retrieve event flags (may throw on EV_ERROR) events = pollptr.getEventFlags(i); // 3. 🚨 NEW: Handle EV_EOF (Graceful Connection Close/Hangup) // If EV_EOF is set, close the connection and skip other handlers. if (events & EV_EOF) { pollptr.CloseEventHandler(i, tid, args); continue; } // 4. Prioritize read events (new data from client) if (events & EVFILT_READ) { pollptr.ReadEventHandler(i, tid, args); Loading