Commit 94b4ee43 authored by jan.koester's avatar jan.koester
Browse files

fixed inherhit

parent fc8fe16f
Loading
Loading
Loading
Loading
+2 −12
Changes for src/eventapi.h: 2 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -52,17 +52,6 @@ namespace netplus {
            virtual void WriteEventHandler(int pos)=0;
            virtual void CloseEventHandler(int pos)=0;


            /*HTTP API Events*/
            virtual void RequestEvent(con *curcon)=0;
            virtual void ResponseEvent(con *curcon)=0;
            virtual void ConnectEvent(con *curcon)=0;
            virtual void DisconnectEvent(con *curcon)=0;

            /*memory allocation*/
            virtual void CreateConnetion(con **curon)=0;
            virtual void deleteConnetion(con *curon)=0;

            /*Connection Ready to send Data
             * DANGEROUS to burnout your cpu
             *only use this if know what you do!*/
@@ -75,12 +64,13 @@ namespace netplus {
            void runEventloop();
            static void *WorkerThread(void *wrkevent);

            /*Events*/
            /*HTTP API Events*/
            virtual void RequestEvent(con *curcon);
            virtual void ResponseEvent(con *curcon);
            virtual void ConnectEvent(con *curcon);
            virtual void DisconnectEvent(con *curcon);

            /*memory allocation*/
            virtual void CreateConnetion(con **curon);
            virtual void deleteConnetion(con *curon);

+21 −37
Changes for src/linux/event.cpp: 21 added lines, 37 removed lines.
Original line number Diff line number Diff line
@@ -63,9 +63,9 @@ __attribute__((__packed__))
;

namespace netplus {
    class poll : public eventapi{
    class poll : public event,public eventapi{
    public:
        poll(socket* serversocket) {
        poll(socket* serversocket) : event(serversocket){
            _ServerSocket = serversocket;
            _EventNums=0;
        };
@@ -291,29 +291,6 @@ namespace netplus {
                }
        };

        void RequestEvent(con *curcon){

        };

        void ResponseEvent(con *curcon){

        };

        void ConnectEvent(con *curcon){
        };

        void DisconnectEvent(con *curcon){

        };

        void CreateConnetion(con **curon){
            *curon=new con();
        }

        void deleteConnetion(con *curon){
            delete curon;
        }

    private:
        int                  _pollFD;
        struct  poll_event  *_Events;
@@ -413,22 +390,29 @@ namespace netplus {
    event::~event() {
    }

    void RequestEvent(con *curcon){
        //dummy
    };

    void event::RequestEvent(con* curcon) {
        return;
    }
    void ResponseEvent(con *curcon){
        //dummy
    };

    void event::ResponseEvent(con* curcon) {
        return;
    }
    void ConnectEvent(con *curcon){
        //dummy
    };

    void event::ConnectEvent(con* curcon) {
        return;
    }
    void DisconnectEvent(con *curcon){
        //dummy
    };

    void event::DisconnectEvent(con* curcon) {
        return;
    }
    void CreateConnetion(con **curcon){
        *curcon=new con();
    };

    void deleteConnetion(con *curcon){
        delete curcon;
    };

    void event::runEventloop() {
        size_t thrs = sysconf(_SC_NPROCESSORS_ONLN);