Commit 6445276a authored by jan.koester's avatar jan.koester
Browse files

try it

parent 4a71e313
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -519,8 +519,6 @@ namespace netplus {
                    INFINITE
                );

                std::cout << "test2" << std::endl;

                lpIOContext = (poll::PPER_IO_CONTEXT)lpOverlapped;

                switch (lpIOContext->IOOperation) {
@@ -615,7 +613,13 @@ namespace netplus {
                    }

                    args->event->ConnectEvent(lpPerSocketContext->CurCon, tid, args);

                    std::copy(buffRecv.buf,buffRecv.buf+buffRecv.len,std::back_inserter(lpPerSocketContext->CurCon->RecvData));

                    args->event->RequestEvent(lpPerSocketContext->CurCon, tid, args);

                    if(!lpPerSocketContext->CurCon->SendData.empty())
                        lpAcceptSocketContext->pIOContext->IOOperation = poll::ClientIoWrite;
                    //
                    //Time to post another outstanding AcceptEx
                    //
@@ -651,11 +655,17 @@ namespace netplus {
                        delete lpAcceptSocketContext->CurCon->csock;
                        lpAcceptSocketContext->CurCon->csock = nullptr;
                    }

                    std::copy(buffRecv.buf, buffRecv.buf + buffRecv.len, std::back_inserter(lpPerSocketContext->CurCon->RecvData));

                    args->event->RequestEvent(lpPerSocketContext->CurCon, tid, args);

                    break;

                case poll::ClientIoWrite:

                    std::copy(lpPerSocketContext->CurCon->SendData.begin(), lpPerSocketContext->CurCon->SendData.begin() + BLOCKSIZE, buffSend.buf);

                    //
                    // a write operation has completed, determine if all the data intended to be
                    // sent actually was sent.
@@ -706,9 +716,13 @@ namespace netplus {
                            delete lpAcceptSocketContext->CurCon->csock;
                            lpAcceptSocketContext->CurCon->csock = nullptr;
                        }                       
                        break;
                    }

                    lpPerSocketContext->CurCon->SendData.resize(nRet);

                    args->event->ResponseEvent(lpPerSocketContext->CurCon, tid, args);

                    break;
                }
            } catch (NetException &e) {
                if (e.getErrorType() == NetException::Note || NetException::Warning)