Loading src/event/iocp.cpp +8 −8 Changes for src/event/iocp.cpp: 8 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -65,16 +65,16 @@ namespace netplus { class client { public: client(std::shared_ptr<eventapi> eapi) : api(eapi), State(IO_READ_STATE) { api->CreateConnetion(CurCon); client(eventapi *eapi) : api(eapi), State(IO_READ_STATE) { api->CreateConnection(&CurCon); } ~client() { } int State; std::shared_ptr<eventapi> api; std::shared_ptr<con> CurCon; eventapi *api; con *CurCon; std::mutex cltmtx; }; Loading Loading @@ -177,8 +177,8 @@ namespace netplus { //dummy }; void eventapi::CreateConnetion(std::shared_ptr<con> curcon) { curcon = std::shared_ptr<con>(new con(shared_from_this())); void eventapi::CreateConnetion(con *curcon) { curcon = new con(this); } class EventWorkerArgs { Loading Loading @@ -238,14 +238,14 @@ namespace netplus { try { std::lock_guard clock(pClientContext->cltmtx); auto& curCon = pClientContext->CurCon; con *curCon = pClientContext->CurCon; switch (pClientContext->State) { case IO_WRITE_STATE: { eargs->event->ResponseEvent(curCon, tid, args); ULONG ssize = curCon->SendData->size() < BLOCKSIZE ? (ULONG)curCon->SendData->size() : BLOCKSIZE; DWORD ret = 0; ret = curCon->csock->sendData(std::reinterpret_pointer_cast<const char[]>(curCon->SendData), ssize, 0); ret = curCon->csock->sendData(curCon->SendData.data(), ssize, 0); curCon->SendData->resize(ret); if (curCon->SendData->empty()) pClientContext->State = IO_READ_STATE; Loading Loading
src/event/iocp.cpp +8 −8 Changes for src/event/iocp.cpp: 8 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -65,16 +65,16 @@ namespace netplus { class client { public: client(std::shared_ptr<eventapi> eapi) : api(eapi), State(IO_READ_STATE) { api->CreateConnetion(CurCon); client(eventapi *eapi) : api(eapi), State(IO_READ_STATE) { api->CreateConnection(&CurCon); } ~client() { } int State; std::shared_ptr<eventapi> api; std::shared_ptr<con> CurCon; eventapi *api; con *CurCon; std::mutex cltmtx; }; Loading Loading @@ -177,8 +177,8 @@ namespace netplus { //dummy }; void eventapi::CreateConnetion(std::shared_ptr<con> curcon) { curcon = std::shared_ptr<con>(new con(shared_from_this())); void eventapi::CreateConnetion(con *curcon) { curcon = new con(this); } class EventWorkerArgs { Loading Loading @@ -238,14 +238,14 @@ namespace netplus { try { std::lock_guard clock(pClientContext->cltmtx); auto& curCon = pClientContext->CurCon; con *curCon = pClientContext->CurCon; switch (pClientContext->State) { case IO_WRITE_STATE: { eargs->event->ResponseEvent(curCon, tid, args); ULONG ssize = curCon->SendData->size() < BLOCKSIZE ? (ULONG)curCon->SendData->size() : BLOCKSIZE; DWORD ret = 0; ret = curCon->csock->sendData(std::reinterpret_pointer_cast<const char[]>(curCon->SendData), ssize, 0); ret = curCon->csock->sendData(curCon->SendData.data(), ssize, 0); curCon->SendData->resize(ret); if (curCon->SendData->empty()) pClientContext->State = IO_READ_STATE; Loading