Commit 5430ed4e authored by jan.koester's avatar jan.koester
Browse files

tets

parent cc58c7d0
Loading
Loading
Loading
Loading
+6 −5
Changes for src/event/kqueue.cpp: 6 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -198,10 +198,11 @@ namespace netplus {
            ccon->lasteventime = time(nullptr);

            struct kevent setevent {};
            setevent.udata = ccon.get();
            setevent.udata = ccon.release();

            con *sccon=setevent.udata;

            EV_SET(&setevent, ccon->csock->fd(), EVFILT_READ, EV_ADD | EV_ONESHOT,0,0,ccon.get());
            EV_SET(&setevent, ccon->csock->fd(), EVFILT_READ, EV_ADD | EV_ONESHOT,0,0,sccon);

            int estate = kevent(_pollFD, &setevent, 1, nullptr, 0, nullptr);

@@ -212,10 +213,10 @@ namespace netplus {
                throw exception;
            }

            evconnection ->ConnectEvent(*ccon,tid,args);
            evconnection ->ConnectEvent(sccon,tid,args);
            {
                std::lock_guard<std::mutex> clock(ccon->event_mutex),global_lock(POLL_HANDLER_MUTEX);
                CONNECTIONS.emplace(ccon->csock->fd(),ccon.release());
                std::lock_guard<std::mutex> clock(sccon->event_mutex),global_lock(POLL_HANDLER_MUTEX);
                CONNECTIONS.emplace(sccon->csock->fd(),sccon);
            }

        };