Commit 6aaa695a authored by jan.koester's avatar jan.koester
Browse files

add del method to api

parent d3f58f8f
Loading
Loading
Loading
Loading
+5 −1
Changes for src/event/epoll.cpp: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -280,7 +280,7 @@ namespace netplus {
                    }
                    evconnection->DisconnectEvent(*ccon,tid,args);
                    delete ccon->csock;
                    delete reinterpret_cast<con*>(_Events[pos].data.ptr);
                    evconnection->DestroyConnection(ccon);
                    _Events[pos].data.ptr=nullptr;

                }
@@ -407,6 +407,10 @@ namespace netplus {
        *res=new con(this);
    }

    void event::DestroyConnection(con *res){
        delete res;
    }

    void event::runEventloop(ULONG_PTR args) {
        NetException exception;

+2
Changes for src/eventapi.h: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ namespace netplus {
            virtual void DisconnectEvent(con &curcon,const int tid, ULONG_PTR args)=0;
            /*memory allocation*/
            virtual  void CreateConnection(con **res)=0;
            virtual  void DestroyConnection(con *res)=0;
        protected:
            eventapi(){};
        };
@@ -65,6 +66,7 @@ namespace netplus {
            int                      threads;
        protected:
            void CreateConnection(con **res);
            void DestroyConnection(con *res);
            event(const event &src);
        private:
            socket   *_ServerSocket;