Loading src/event/epoll.cpp +13 −13 Original line number Diff line number Diff line Loading @@ -75,10 +75,10 @@ namespace netplus { /*EventHandler*/ virtual int waitEventHandler(int timeout)=0; virtual void ConnectEventHandler(int pos,const int tid,void *args)=0; virtual void ReadEventHandler(int pos,const int tid,void *args)=0; virtual void WriteEventHandler(int pos,const int tid,void *args)=0; virtual void CloseEventHandler(int pos,const int tid,void *args)=0; virtual void ConnectEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void ReadEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void WriteEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void CloseEventHandler(int pos,const int tid,ULONG_PTR args)=0; protected: eventapi *_evtapi; Loading Loading @@ -156,7 +156,7 @@ namespace netplus { return evn; }; void ConnectEventHandler(int pos,const int tid,void *args) { void ConnectEventHandler(int pos,const int tid,ULONG_PTR args) { NetException exception; con *ccon; Loading Loading @@ -197,7 +197,7 @@ namespace netplus { }; void ReadEventHandler(int pos,const int tid,void *args) { void ReadEventHandler(int pos,const int tid,ULONG_PTR args) { con *rcon = (con*)_Events[pos].data.ptr; try{ std::shared_ptr<char[]> buf( new char[BLOCKSIZE], []( char *p ){ delete [] p; }); Loading Loading @@ -230,7 +230,7 @@ namespace netplus { } }; void WriteEventHandler(int pos,const int tid,void *args) { void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { con *wcon = (con*)_Events[pos].data.ptr; try{ Loading Loading @@ -267,7 +267,7 @@ namespace netplus { }; void CloseEventHandler(int pos,const int tid,void *args) { void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { con *ccon = (con*)_Events[pos].data.ptr; try{ if(_pollFD!=pos){ Loading Loading @@ -373,19 +373,19 @@ EVENTLOOP: } }; void eventapi::RequestEvent(con *curcon,const int tid,void *args){ void eventapi::RequestEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ResponseEvent(con *curcon,const int tid,void *args){ void eventapi::ResponseEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ConnectEvent(con *curcon,const int tid,void *args){ void eventapi::ConnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::DisconnectEvent(con *curcon,const int tid,void *args){ void eventapi::DisconnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; Loading Loading @@ -454,7 +454,7 @@ MAINWORKERLOOP: for (int i = 0; i < threads; i++) { try { threadpool.push_back( std::thread([&eargs,i]{ threadpool.push_back( std::thread([&eargs,args,i]{ EventWorker(i,args,&eargs); })); } catch (NetException& e) { Loading src/event/kqueue.cpp +17 −17 Original line number Diff line number Diff line Loading @@ -72,10 +72,10 @@ namespace netplus { /*EventHandler*/ virtual int waitEventHandler()=0; virtual void ConnectEventHandler(int pos,const int tid,void *args)=0; virtual void ReadEventHandler(int pos,const int tid,void *args)=0; virtual void WriteEventHandler(int pos,const int tid,void *args)=0; virtual void CloseEventHandler(int pos,const int tid,void *args)=0; virtual void ConnectEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void ReadEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void WriteEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void CloseEventHandler(int pos,const int tid,ULONG_PTR args)=0; protected: eventapi *_evtapi; Loading Loading @@ -155,7 +155,7 @@ namespace netplus { return evn; }; void ConnectEventHandler(int pos,const int tid,void *args) { void ConnectEventHandler(int pos,const int tid,ULONG_PTR args) { NetException exception; con *ccon; Loading Loading @@ -195,7 +195,7 @@ namespace netplus { }; void ReadEventHandler(int pos,const int tid,void *args) { void ReadEventHandler(int pos,const int tid,ULONG_PTR args) { con *rcon = (con*)_Events[pos].udata; if(!rcon) Loading Loading @@ -231,7 +231,7 @@ namespace netplus { } }; void WriteEventHandler(int pos,const int tid,void *args) { void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { con *wcon = (con*)_Events[pos].udata; try{ Loading Loading @@ -268,7 +268,7 @@ namespace netplus { }; void CloseEventHandler(int pos,const int tid,void *args) { void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { con *ccon = (con*)_Events[pos].udata; if(!ccon) Loading Loading @@ -332,8 +332,8 @@ namespace netplus { class EventWorker { public: EventWorker(int tid,EventWorkerArgs* args) { poll pollptr(args->ssocket,args->event,args->pollfd,args->timeout); EventWorker(int tid,ULONG_PTR args,EventWorkerArgs* eargs) { poll pollptr(eargs->ssocket,eargs->event,eargs->pollfd,eargs->timeout); EVENTLOOP: try { Loading Loading @@ -380,19 +380,19 @@ EVENTLOOP: } }; void eventapi::RequestEvent(con *curcon,const int tid,void *args){ void eventapi::RequestEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ResponseEvent(con *curcon,const int tid,void *args){ void eventapi::ResponseEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ConnectEvent(con *curcon,const int tid,void *args){ void eventapi::ConnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::DisconnectEvent(con *curcon,const int tid,void *args){ void eventapi::DisconnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; Loading Loading @@ -421,7 +421,7 @@ EVENTLOOP: event::~event() { } void event::runEventloop() { void event::runEventloop(ULONG_PTR args) { NetException exception; signal(SIGPIPE, SIG_IGN); Loading Loading @@ -459,8 +459,8 @@ EVENTLOOP: for (size_t i = 0; i < threads; i++) { try { threadpool[i] = new std::thread([&eargs,i]{ EventWorker *evt = new EventWorker(i,&eargs); threadpool[i] = new std::thread([&eargs,args,i]{ EventWorker *evt = new EventWorker(i,args,&eargs); delete evt; }); } catch (NetException& e) { Loading src/eventapi.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ #pragma once #ifndef Windows typedef ULONG_PTR unsigned long long; typedef unsigned long long ULONG_PTR; #endif namespace netplus { Loading src/socket.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ #ifndef Windows typedef int SOCKET; typedef ULONG_PTR unsigned long long; typedef unsigned long long ULONG_PTR; #else #include <winsock.h> #endif Loading Loading
src/event/epoll.cpp +13 −13 Original line number Diff line number Diff line Loading @@ -75,10 +75,10 @@ namespace netplus { /*EventHandler*/ virtual int waitEventHandler(int timeout)=0; virtual void ConnectEventHandler(int pos,const int tid,void *args)=0; virtual void ReadEventHandler(int pos,const int tid,void *args)=0; virtual void WriteEventHandler(int pos,const int tid,void *args)=0; virtual void CloseEventHandler(int pos,const int tid,void *args)=0; virtual void ConnectEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void ReadEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void WriteEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void CloseEventHandler(int pos,const int tid,ULONG_PTR args)=0; protected: eventapi *_evtapi; Loading Loading @@ -156,7 +156,7 @@ namespace netplus { return evn; }; void ConnectEventHandler(int pos,const int tid,void *args) { void ConnectEventHandler(int pos,const int tid,ULONG_PTR args) { NetException exception; con *ccon; Loading Loading @@ -197,7 +197,7 @@ namespace netplus { }; void ReadEventHandler(int pos,const int tid,void *args) { void ReadEventHandler(int pos,const int tid,ULONG_PTR args) { con *rcon = (con*)_Events[pos].data.ptr; try{ std::shared_ptr<char[]> buf( new char[BLOCKSIZE], []( char *p ){ delete [] p; }); Loading Loading @@ -230,7 +230,7 @@ namespace netplus { } }; void WriteEventHandler(int pos,const int tid,void *args) { void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { con *wcon = (con*)_Events[pos].data.ptr; try{ Loading Loading @@ -267,7 +267,7 @@ namespace netplus { }; void CloseEventHandler(int pos,const int tid,void *args) { void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { con *ccon = (con*)_Events[pos].data.ptr; try{ if(_pollFD!=pos){ Loading Loading @@ -373,19 +373,19 @@ EVENTLOOP: } }; void eventapi::RequestEvent(con *curcon,const int tid,void *args){ void eventapi::RequestEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ResponseEvent(con *curcon,const int tid,void *args){ void eventapi::ResponseEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ConnectEvent(con *curcon,const int tid,void *args){ void eventapi::ConnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::DisconnectEvent(con *curcon,const int tid,void *args){ void eventapi::DisconnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; Loading Loading @@ -454,7 +454,7 @@ MAINWORKERLOOP: for (int i = 0; i < threads; i++) { try { threadpool.push_back( std::thread([&eargs,i]{ threadpool.push_back( std::thread([&eargs,args,i]{ EventWorker(i,args,&eargs); })); } catch (NetException& e) { Loading
src/event/kqueue.cpp +17 −17 Original line number Diff line number Diff line Loading @@ -72,10 +72,10 @@ namespace netplus { /*EventHandler*/ virtual int waitEventHandler()=0; virtual void ConnectEventHandler(int pos,const int tid,void *args)=0; virtual void ReadEventHandler(int pos,const int tid,void *args)=0; virtual void WriteEventHandler(int pos,const int tid,void *args)=0; virtual void CloseEventHandler(int pos,const int tid,void *args)=0; virtual void ConnectEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void ReadEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void WriteEventHandler(int pos,const int tid,ULONG_PTR args)=0; virtual void CloseEventHandler(int pos,const int tid,ULONG_PTR args)=0; protected: eventapi *_evtapi; Loading Loading @@ -155,7 +155,7 @@ namespace netplus { return evn; }; void ConnectEventHandler(int pos,const int tid,void *args) { void ConnectEventHandler(int pos,const int tid,ULONG_PTR args) { NetException exception; con *ccon; Loading Loading @@ -195,7 +195,7 @@ namespace netplus { }; void ReadEventHandler(int pos,const int tid,void *args) { void ReadEventHandler(int pos,const int tid,ULONG_PTR args) { con *rcon = (con*)_Events[pos].udata; if(!rcon) Loading Loading @@ -231,7 +231,7 @@ namespace netplus { } }; void WriteEventHandler(int pos,const int tid,void *args) { void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { con *wcon = (con*)_Events[pos].udata; try{ Loading Loading @@ -268,7 +268,7 @@ namespace netplus { }; void CloseEventHandler(int pos,const int tid,void *args) { void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { con *ccon = (con*)_Events[pos].udata; if(!ccon) Loading Loading @@ -332,8 +332,8 @@ namespace netplus { class EventWorker { public: EventWorker(int tid,EventWorkerArgs* args) { poll pollptr(args->ssocket,args->event,args->pollfd,args->timeout); EventWorker(int tid,ULONG_PTR args,EventWorkerArgs* eargs) { poll pollptr(eargs->ssocket,eargs->event,eargs->pollfd,eargs->timeout); EVENTLOOP: try { Loading Loading @@ -380,19 +380,19 @@ EVENTLOOP: } }; void eventapi::RequestEvent(con *curcon,const int tid,void *args){ void eventapi::RequestEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ResponseEvent(con *curcon,const int tid,void *args){ void eventapi::ResponseEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ConnectEvent(con *curcon,const int tid,void *args){ void eventapi::ConnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::DisconnectEvent(con *curcon,const int tid,void *args){ void eventapi::DisconnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; Loading Loading @@ -421,7 +421,7 @@ EVENTLOOP: event::~event() { } void event::runEventloop() { void event::runEventloop(ULONG_PTR args) { NetException exception; signal(SIGPIPE, SIG_IGN); Loading Loading @@ -459,8 +459,8 @@ EVENTLOOP: for (size_t i = 0; i < threads; i++) { try { threadpool[i] = new std::thread([&eargs,i]{ EventWorker *evt = new EventWorker(i,&eargs); threadpool[i] = new std::thread([&eargs,args,i]{ EventWorker *evt = new EventWorker(i,args,&eargs); delete evt; }); } catch (NetException& e) { Loading
src/eventapi.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ #pragma once #ifndef Windows typedef ULONG_PTR unsigned long long; typedef unsigned long long ULONG_PTR; #endif namespace netplus { Loading
src/socket.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ #ifndef Windows typedef int SOCKET; typedef ULONG_PTR unsigned long long; typedef unsigned long long ULONG_PTR; #else #include <winsock.h> #endif Loading