Commit 516bbddc authored by jan.koester's avatar jan.koester
Browse files

test

parent 57310eda
Loading
Loading
Loading
Loading
+2 −9
Changes for src/event/kqueue.cpp: 2 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -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;
@@ -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);