Loading .kdev4/libnetplus.kdev4 +1 −1 Changes for .kdev4/libnetplus.kdev4: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ CMake Binary=/usr/bin/cmake CMake Executable=/usr/bin/cmake Environment Profile= Extra Arguments= Install Directory= Install Directory=/usr/local Runtime=Host System [CMake][CMake Build Directory 1] Loading CMakeLists.txt +1 −1 Changes for CMakeLists.txt: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH} ) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 17) #find_package(MbedTLS REQUIRED) Loading src/connection.cpp +14 −10 Changes for src/connection.cpp: 14 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -58,13 +58,17 @@ netplus::condata<char>::condata(const condata<char> &src) : vector(src) { netplus::condata<char>::condata(const std::vector<char> &src){ pos=0; std::copy(src.begin(),src.end(),std::inserter<std::vector<char,condataAlloc<char>>>(*this,end())); std::copy(src.begin(),src.end(),std::inserter<std::vector<char,condataAlloc<char>>>(*this,std::vector<char,condataAlloc<char>>::end())); } void netplus::condata<char>::resize(size_t size_c){ size_t rs = size(); size_t rs = std::vector<char,condataAlloc<char>>::size(); std::move(begin()+size_c,end(),begin()); std::move( std::vector<char,condataAlloc<char>>::begin()+size_c, std::vector<char,condataAlloc<char>>::end(), std::vector<char,condataAlloc<char>>::begin() ); std::vector<char,condataAlloc<char>>::resize(rs-size_c); } Loading @@ -76,19 +80,19 @@ bool netplus::condata<char>::empty(){ void netplus::condata<char>::append(const char* data, size_t datalen){ if (data == data + datalen) return; std::copy(data,data+datalen,std::back_inserter(*this)); std::copy(data,data+datalen,std::back_inserter<std::vector<char,condataAlloc<char>>>(*this)); } size_t netplus::condata<char>::search(const char* word,size_t pos){ size_t wsize=strlen(word); for(size_t i=pos; i<size(); ++i){ for(size_t i=pos; i<std::vector<char,condataAlloc<char>>::size(); ++i){ for(size_t ii=0; ii<=wsize; ++ii){ if(ii==wsize){ return i-wsize; } if(i>=size() || ii>=wsize) if(i>=std::vector<char,condataAlloc<char>>::size() || ii>=wsize) break; if(at(i)==word[ii]){ if(std::vector<char,condataAlloc<char>>::at(i)==word[ii]){ ++i; continue; } Loading @@ -104,15 +108,15 @@ size_t netplus::condata<char>::search(const char* word){ } void netplus::condata<char>::push_back(char a){ std::vector<char,condataAlloc<char>>push_back(a); std::vector<char, netplus::condataAlloc<char> >::push_back(a); } netplus::con::con() { netplus::con::con() : csock(nullptr){ state=0; lasteventime = time(nullptr); } netplus::con::con(std::shared_ptr<eventapi> event) : _event(event) { netplus::con::con(eventapi *event) : csock(nullptr) { state = 0; lasteventime = time(nullptr); } Loading src/connection.h +14 −6 Changes for src/connection.h: 14 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -39,8 +39,18 @@ namespace netplus { class eventapi; class pollapi; template<typename T> struct condata_traits { using reference = T &; using const_reference = const T &; }; template<> struct condata_traits<void> { }; template <class T> class condataAlloc { class condataAlloc : public condata_traits<T>{ public: // type definitions typedef T value_type; Loading Loading @@ -137,11 +147,12 @@ namespace netplus { class con { public: con(std::shared_ptr<eventapi> event); con(eventapi *event); con(const netplus::con&) =delete; virtual ~con(); /*clientsocket*/ std::shared_ptr <socket> csock; socket *csock; /*event stauts*/ int state; Loading @@ -153,9 +164,6 @@ namespace netplus { protected: con(); int lasteventime; private: std::shared_ptr<eventapi> _event; std::shared_ptr<pollapi> _pollapi; friend class poll; }; }; src/event/epoll.cpp +44 −56 Changes for src/event/epoll.cpp: 44 added lines, 56 removed lines. Original line number Diff line number Diff line Loading @@ -57,18 +57,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define BLOCKSIZE 16384 namespace netplus { class client : public std::enable_shared_from_this<client>{ public: client(std::shared_ptr<eventapi> evcon) { evcon->CreateConnection(connection); } virtual ~client(){ } std::shared_ptr<con> connection; }; class pollapi { public: pollapi(std::shared_ptr<eventapi> evcon,int timeout) : evconnection(evcon){ Loading Loading @@ -115,7 +103,8 @@ namespace netplus { ~poll() { for (int i = 0; i <_ServerSocket->getMaxconnections(); ++i){ delete reinterpret_cast<client*>(_Events[i].data.ptr); delete static_cast<con*>(_Events[i].data.ptr)->csock; delete static_cast<con*>(_Events[i].data.ptr); } }; Loading @@ -129,12 +118,14 @@ namespace netplus { }; void setpollEvents(int pos,std::shared_ptr<con> curcon,int events){ void setpollEvents(int pos,int events){ NetException except; struct epoll_event setevent = { 0 }; setevent.events = events; setevent.data.ptr = _Events[pos].data.ptr; con *curcon = reinterpret_cast<con*>(_Events[pos].data.ptr); if (epoll_ctl(_pollFD, EPOLL_CTL_MOD,curcon->csock->fd() ,&setevent) < 0) { except[NetException::Error] << "_setEpollEvents: can change socket!"; Loading @@ -146,8 +137,8 @@ namespace netplus { if(!_Events[pos].data.ptr) return EventHandlerStatus::EVCON; std::shared_ptr<con> pcon=reinterpret_cast<client*>(_Events[pos].data.ptr)->connection; std::cout << pcon->state << std::endl; con *pcon = reinterpret_cast<con*>(_Events[pos].data.ptr); return pcon->state; } Loading @@ -167,16 +158,16 @@ namespace netplus { void ConnectEventHandler(int pos,const int tid,ULONG_PTR args) { NetException exception; client *clt = new client(evconnection); con *ccon=nullptr; std::shared_ptr<con> &ccon=clt->connection; evconnection->CreateConnection(reinterpret_cast<void**>(&ccon)); if(_ServerSocket->_Type==sockettype::TCP){ ccon->csock=std::make_shared<tcp>( -1); ccon->csock=new tcp(-1); }else if(_ServerSocket->_Type==sockettype::UDP){ ccon->csock=std::make_shared<udp>(-1); ccon->csock=new udp( -1); }else if(_ServerSocket->_Type==sockettype::SSL){ ccon->csock=std::make_shared<ssl>(); // clt->connection->csock=std::make_shared<ssl>( -1); } _ServerSocket->accept(ccon->csock); Loading @@ -192,7 +183,7 @@ namespace netplus { struct epoll_event setevent { 0 }; setevent.events = EPOLLIN | EPOLLONESHOT; setevent.data.ptr = clt; setevent.data.ptr = ccon; int estate = epoll_ctl(_pollFD, EPOLL_CTL_ADD,ccon->csock->fd(), &setevent); Loading @@ -200,78 +191,76 @@ namespace netplus { char errstr[255]; strerror_r_netplus(errno,errstr,255); exception[NetException::Error] << "ConnectEventHandler: can't add socket to epoll: " << errstr; delete clt; throw exception; } ccon->_event->ConnectEvent(ccon,tid,args); evconnection ->ConnectEvent(ccon,tid,args); }; void ReadEventHandler(int pos,const int tid,ULONG_PTR args) { std::shared_ptr<con> rcon=reinterpret_cast<client*>(_Events[pos].data.ptr)->connection; con *rcon = reinterpret_cast<con*>(_Events[pos].data.ptr); char *buf=new char[BLOCKSIZE]; try{ std::shared_ptr<char[]> buf( new char[BLOCKSIZE], []( char *p ){ delete [] p; }); size_t rcvsize = rcon->csock->recvData(buf, BLOCKSIZE); size_t rcvsize = rcon->csock->recvData(&buf, BLOCKSIZE); std::cerr.write(buf,rcvsize)<<std::endl; rcon->lasteventime = time(nullptr); if(rcvsize!=0){ rcon->RecvData.append(buf.get(),rcvsize); rcon->RecvData.append(buf,rcvsize); rcon->state=EVIN; } rcon->_event->RequestEvent(rcon,tid,args); evconnection->RequestEvent(rcon,tid,args); if(!rcon->SendData.empty()){ rcon->state=EVOUT; setpollEvents(pos,rcon,EPOLLOUT | EPOLLONESHOT); setpollEvents(pos,EPOLLOUT | EPOLLONESHOT); return; } setpollEvents(pos,rcon,EPOLLIN | EPOLLONESHOT); setpollEvents(pos,EPOLLIN | EPOLLONESHOT); }catch(NetException &e){ delete[] buf; if(e.getErrorType()== NetException::Note){ rcon->state=EVIN; setpollEvents(pos,rcon,EPOLLIN | EPOLLONESHOT); setpollEvents(pos,EPOLLIN | EPOLLONESHOT); return; } throw e; } delete[] buf; }; void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { std::shared_ptr<con> wcon=reinterpret_cast<client*>(_Events[pos].data.ptr)->connection; con *wcon = reinterpret_cast<con*>(_Events[pos].data.ptr); try{ wcon->_event->ResponseEvent(wcon,tid,args); evconnection->ResponseEvent(wcon,tid,args); if(wcon->SendData.empty()){ wcon->state=EVIN; setpollEvents(pos,wcon,EPOLLIN | EPOLLONESHOT); setpollEvents(pos,EPOLLIN | EPOLLONESHOT); return; } size_t ssize = BLOCKSIZE < wcon->SendData.size() ? BLOCKSIZE : wcon->SendData.size(); size_t sended; wcon->state=EVOUT; std::shared_ptr<const char[]> buf(wcon->SendData.data()); sended = wcon->csock->sendData(buf,ssize); size_t sended = wcon->csock->sendData(wcon->SendData.data(),ssize); wcon->SendData.resize(sended); wcon->lasteventime = time(nullptr); setpollEvents(pos,wcon,EPOLLOUT | EPOLLONESHOT); setpollEvents(pos,EPOLLOUT | EPOLLONESHOT); }catch(NetException &e){ if(e.getErrorType()== NetException::Note){ wcon->state=EVOUT; setpollEvents(pos,wcon,EPOLLOUT | EPOLLONESHOT); setpollEvents(pos,EPOLLOUT | EPOLLONESHOT); return; }else{ throw e; Loading @@ -281,8 +270,7 @@ namespace netplus { void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { std::shared_ptr<con> ccon=reinterpret_cast<client*>(_Events[pos].data.ptr)->connection; con *ccon = reinterpret_cast<con*>(_Events[pos].data.ptr); try{ if(_pollFD!=pos){ Loading @@ -293,9 +281,9 @@ namespace netplus { except[NetException::Error] << "CloseEventHandler: can't close socket to epoll: " << errstr; throw except; } ccon->_event->DisconnectEvent(ccon,tid,args); delete reinterpret_cast<client*>(_Events[pos].data.ptr); evconnection->DisconnectEvent(ccon,tid,args); delete ccon->csock; delete reinterpret_cast<con*>(_Events[pos].data.ptr); _Events[pos].data.ptr=nullptr; } Loading Loading @@ -379,19 +367,19 @@ namespace netplus { } }; void eventapi::RequestEvent(std::shared_ptr<con> curcon,const int tid,ULONG_PTR args){ void eventapi::RequestEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ResponseEvent(std::shared_ptr<con> curcon,const int tid,ULONG_PTR args){ void eventapi::ResponseEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ConnectEvent(std::shared_ptr<con> curcon,const int tid,ULONG_PTR args){ void eventapi::ConnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::DisconnectEvent(std::shared_ptr<con> curcon,const int tid,ULONG_PTR args){ void eventapi::DisconnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; Loading @@ -418,8 +406,8 @@ namespace netplus { raise(SIGINT); } void event::CreateConnection(std::shared_ptr <con> &curcon){ curcon=std::make_shared<con>(shared_from_this()); void event::CreateConnection(void **res){ *res=new con(this); } void event::runEventloop(ULONG_PTR args) { Loading Loading
.kdev4/libnetplus.kdev4 +1 −1 Changes for .kdev4/libnetplus.kdev4: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ CMake Binary=/usr/bin/cmake CMake Executable=/usr/bin/cmake Environment Profile= Extra Arguments= Install Directory= Install Directory=/usr/local Runtime=Host System [CMake][CMake Build Directory 1] Loading
CMakeLists.txt +1 −1 Changes for CMakeLists.txt: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH} ) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 17) #find_package(MbedTLS REQUIRED) Loading
src/connection.cpp +14 −10 Changes for src/connection.cpp: 14 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -58,13 +58,17 @@ netplus::condata<char>::condata(const condata<char> &src) : vector(src) { netplus::condata<char>::condata(const std::vector<char> &src){ pos=0; std::copy(src.begin(),src.end(),std::inserter<std::vector<char,condataAlloc<char>>>(*this,end())); std::copy(src.begin(),src.end(),std::inserter<std::vector<char,condataAlloc<char>>>(*this,std::vector<char,condataAlloc<char>>::end())); } void netplus::condata<char>::resize(size_t size_c){ size_t rs = size(); size_t rs = std::vector<char,condataAlloc<char>>::size(); std::move(begin()+size_c,end(),begin()); std::move( std::vector<char,condataAlloc<char>>::begin()+size_c, std::vector<char,condataAlloc<char>>::end(), std::vector<char,condataAlloc<char>>::begin() ); std::vector<char,condataAlloc<char>>::resize(rs-size_c); } Loading @@ -76,19 +80,19 @@ bool netplus::condata<char>::empty(){ void netplus::condata<char>::append(const char* data, size_t datalen){ if (data == data + datalen) return; std::copy(data,data+datalen,std::back_inserter(*this)); std::copy(data,data+datalen,std::back_inserter<std::vector<char,condataAlloc<char>>>(*this)); } size_t netplus::condata<char>::search(const char* word,size_t pos){ size_t wsize=strlen(word); for(size_t i=pos; i<size(); ++i){ for(size_t i=pos; i<std::vector<char,condataAlloc<char>>::size(); ++i){ for(size_t ii=0; ii<=wsize; ++ii){ if(ii==wsize){ return i-wsize; } if(i>=size() || ii>=wsize) if(i>=std::vector<char,condataAlloc<char>>::size() || ii>=wsize) break; if(at(i)==word[ii]){ if(std::vector<char,condataAlloc<char>>::at(i)==word[ii]){ ++i; continue; } Loading @@ -104,15 +108,15 @@ size_t netplus::condata<char>::search(const char* word){ } void netplus::condata<char>::push_back(char a){ std::vector<char,condataAlloc<char>>push_back(a); std::vector<char, netplus::condataAlloc<char> >::push_back(a); } netplus::con::con() { netplus::con::con() : csock(nullptr){ state=0; lasteventime = time(nullptr); } netplus::con::con(std::shared_ptr<eventapi> event) : _event(event) { netplus::con::con(eventapi *event) : csock(nullptr) { state = 0; lasteventime = time(nullptr); } Loading
src/connection.h +14 −6 Changes for src/connection.h: 14 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -39,8 +39,18 @@ namespace netplus { class eventapi; class pollapi; template<typename T> struct condata_traits { using reference = T &; using const_reference = const T &; }; template<> struct condata_traits<void> { }; template <class T> class condataAlloc { class condataAlloc : public condata_traits<T>{ public: // type definitions typedef T value_type; Loading Loading @@ -137,11 +147,12 @@ namespace netplus { class con { public: con(std::shared_ptr<eventapi> event); con(eventapi *event); con(const netplus::con&) =delete; virtual ~con(); /*clientsocket*/ std::shared_ptr <socket> csock; socket *csock; /*event stauts*/ int state; Loading @@ -153,9 +164,6 @@ namespace netplus { protected: con(); int lasteventime; private: std::shared_ptr<eventapi> _event; std::shared_ptr<pollapi> _pollapi; friend class poll; }; };
src/event/epoll.cpp +44 −56 Changes for src/event/epoll.cpp: 44 added lines, 56 removed lines. Original line number Diff line number Diff line Loading @@ -57,18 +57,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define BLOCKSIZE 16384 namespace netplus { class client : public std::enable_shared_from_this<client>{ public: client(std::shared_ptr<eventapi> evcon) { evcon->CreateConnection(connection); } virtual ~client(){ } std::shared_ptr<con> connection; }; class pollapi { public: pollapi(std::shared_ptr<eventapi> evcon,int timeout) : evconnection(evcon){ Loading Loading @@ -115,7 +103,8 @@ namespace netplus { ~poll() { for (int i = 0; i <_ServerSocket->getMaxconnections(); ++i){ delete reinterpret_cast<client*>(_Events[i].data.ptr); delete static_cast<con*>(_Events[i].data.ptr)->csock; delete static_cast<con*>(_Events[i].data.ptr); } }; Loading @@ -129,12 +118,14 @@ namespace netplus { }; void setpollEvents(int pos,std::shared_ptr<con> curcon,int events){ void setpollEvents(int pos,int events){ NetException except; struct epoll_event setevent = { 0 }; setevent.events = events; setevent.data.ptr = _Events[pos].data.ptr; con *curcon = reinterpret_cast<con*>(_Events[pos].data.ptr); if (epoll_ctl(_pollFD, EPOLL_CTL_MOD,curcon->csock->fd() ,&setevent) < 0) { except[NetException::Error] << "_setEpollEvents: can change socket!"; Loading @@ -146,8 +137,8 @@ namespace netplus { if(!_Events[pos].data.ptr) return EventHandlerStatus::EVCON; std::shared_ptr<con> pcon=reinterpret_cast<client*>(_Events[pos].data.ptr)->connection; std::cout << pcon->state << std::endl; con *pcon = reinterpret_cast<con*>(_Events[pos].data.ptr); return pcon->state; } Loading @@ -167,16 +158,16 @@ namespace netplus { void ConnectEventHandler(int pos,const int tid,ULONG_PTR args) { NetException exception; client *clt = new client(evconnection); con *ccon=nullptr; std::shared_ptr<con> &ccon=clt->connection; evconnection->CreateConnection(reinterpret_cast<void**>(&ccon)); if(_ServerSocket->_Type==sockettype::TCP){ ccon->csock=std::make_shared<tcp>( -1); ccon->csock=new tcp(-1); }else if(_ServerSocket->_Type==sockettype::UDP){ ccon->csock=std::make_shared<udp>(-1); ccon->csock=new udp( -1); }else if(_ServerSocket->_Type==sockettype::SSL){ ccon->csock=std::make_shared<ssl>(); // clt->connection->csock=std::make_shared<ssl>( -1); } _ServerSocket->accept(ccon->csock); Loading @@ -192,7 +183,7 @@ namespace netplus { struct epoll_event setevent { 0 }; setevent.events = EPOLLIN | EPOLLONESHOT; setevent.data.ptr = clt; setevent.data.ptr = ccon; int estate = epoll_ctl(_pollFD, EPOLL_CTL_ADD,ccon->csock->fd(), &setevent); Loading @@ -200,78 +191,76 @@ namespace netplus { char errstr[255]; strerror_r_netplus(errno,errstr,255); exception[NetException::Error] << "ConnectEventHandler: can't add socket to epoll: " << errstr; delete clt; throw exception; } ccon->_event->ConnectEvent(ccon,tid,args); evconnection ->ConnectEvent(ccon,tid,args); }; void ReadEventHandler(int pos,const int tid,ULONG_PTR args) { std::shared_ptr<con> rcon=reinterpret_cast<client*>(_Events[pos].data.ptr)->connection; con *rcon = reinterpret_cast<con*>(_Events[pos].data.ptr); char *buf=new char[BLOCKSIZE]; try{ std::shared_ptr<char[]> buf( new char[BLOCKSIZE], []( char *p ){ delete [] p; }); size_t rcvsize = rcon->csock->recvData(buf, BLOCKSIZE); size_t rcvsize = rcon->csock->recvData(&buf, BLOCKSIZE); std::cerr.write(buf,rcvsize)<<std::endl; rcon->lasteventime = time(nullptr); if(rcvsize!=0){ rcon->RecvData.append(buf.get(),rcvsize); rcon->RecvData.append(buf,rcvsize); rcon->state=EVIN; } rcon->_event->RequestEvent(rcon,tid,args); evconnection->RequestEvent(rcon,tid,args); if(!rcon->SendData.empty()){ rcon->state=EVOUT; setpollEvents(pos,rcon,EPOLLOUT | EPOLLONESHOT); setpollEvents(pos,EPOLLOUT | EPOLLONESHOT); return; } setpollEvents(pos,rcon,EPOLLIN | EPOLLONESHOT); setpollEvents(pos,EPOLLIN | EPOLLONESHOT); }catch(NetException &e){ delete[] buf; if(e.getErrorType()== NetException::Note){ rcon->state=EVIN; setpollEvents(pos,rcon,EPOLLIN | EPOLLONESHOT); setpollEvents(pos,EPOLLIN | EPOLLONESHOT); return; } throw e; } delete[] buf; }; void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { std::shared_ptr<con> wcon=reinterpret_cast<client*>(_Events[pos].data.ptr)->connection; con *wcon = reinterpret_cast<con*>(_Events[pos].data.ptr); try{ wcon->_event->ResponseEvent(wcon,tid,args); evconnection->ResponseEvent(wcon,tid,args); if(wcon->SendData.empty()){ wcon->state=EVIN; setpollEvents(pos,wcon,EPOLLIN | EPOLLONESHOT); setpollEvents(pos,EPOLLIN | EPOLLONESHOT); return; } size_t ssize = BLOCKSIZE < wcon->SendData.size() ? BLOCKSIZE : wcon->SendData.size(); size_t sended; wcon->state=EVOUT; std::shared_ptr<const char[]> buf(wcon->SendData.data()); sended = wcon->csock->sendData(buf,ssize); size_t sended = wcon->csock->sendData(wcon->SendData.data(),ssize); wcon->SendData.resize(sended); wcon->lasteventime = time(nullptr); setpollEvents(pos,wcon,EPOLLOUT | EPOLLONESHOT); setpollEvents(pos,EPOLLOUT | EPOLLONESHOT); }catch(NetException &e){ if(e.getErrorType()== NetException::Note){ wcon->state=EVOUT; setpollEvents(pos,wcon,EPOLLOUT | EPOLLONESHOT); setpollEvents(pos,EPOLLOUT | EPOLLONESHOT); return; }else{ throw e; Loading @@ -281,8 +270,7 @@ namespace netplus { void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { std::shared_ptr<con> ccon=reinterpret_cast<client*>(_Events[pos].data.ptr)->connection; con *ccon = reinterpret_cast<con*>(_Events[pos].data.ptr); try{ if(_pollFD!=pos){ Loading @@ -293,9 +281,9 @@ namespace netplus { except[NetException::Error] << "CloseEventHandler: can't close socket to epoll: " << errstr; throw except; } ccon->_event->DisconnectEvent(ccon,tid,args); delete reinterpret_cast<client*>(_Events[pos].data.ptr); evconnection->DisconnectEvent(ccon,tid,args); delete ccon->csock; delete reinterpret_cast<con*>(_Events[pos].data.ptr); _Events[pos].data.ptr=nullptr; } Loading Loading @@ -379,19 +367,19 @@ namespace netplus { } }; void eventapi::RequestEvent(std::shared_ptr<con> curcon,const int tid,ULONG_PTR args){ void eventapi::RequestEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ResponseEvent(std::shared_ptr<con> curcon,const int tid,ULONG_PTR args){ void eventapi::ResponseEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::ConnectEvent(std::shared_ptr<con> curcon,const int tid,ULONG_PTR args){ void eventapi::ConnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; void eventapi::DisconnectEvent(std::shared_ptr<con> curcon,const int tid,ULONG_PTR args){ void eventapi::DisconnectEvent(con *curcon,const int tid,ULONG_PTR args){ //dummy }; Loading @@ -418,8 +406,8 @@ namespace netplus { raise(SIGINT); } void event::CreateConnection(std::shared_ptr <con> &curcon){ curcon=std::make_shared<con>(shared_from_this()); void event::CreateConnection(void **res){ *res=new con(this); } void event::runEventloop(ULONG_PTR args) { Loading