Commit a958df24 authored by jan.koester's avatar jan.koester
Browse files

fixed

parent e55b7f87
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -145,8 +145,6 @@ namespace netplus {

			std::cerr.write(buf.get(), recv) << std::endl;



			g_eventapi->RequestEvent(pClientContext->CurCon, tid, args);

		}
@@ -292,18 +290,19 @@ namespace netplus {
						//Get the data.
						ret = pClientContext->CurCon->csock->recvData(buf.get(), 16384, 0);

						if (ret > 0) {
							pClientContext->CurCon->RecvData.append(buf.get(), ret);

							eargs->event->RequestEvent(pClientContext->CurCon, tid, args);

							ret = pClientContext->CurCon->csock->sendData(buf.get(), ssize, 0);

						}
					}
				}
				catch (NetException& e) {
					std::cerr << e.what() << std::endl;
					if(e.getErrorType()!=NetException::Note)
			     		eargs->evpoll->RemoveFromClientList(pClientContext);
					pClientContext = nullptr;
				}
				eargs->mtx->unlock();
			} // while
@@ -344,7 +343,7 @@ namespace netplus {

		std::vector <std::thread> threadpool;

		for (int i = 1; i < threads; i++) {
		for (int i = 1; i < 2; i++) {
			try {
				threadpool.push_back(std::thread([&eargs, args, i] {
					EventWorker(i, args, &eargs);
+2 −2
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ SENDDATA:
                                       << " ErrorMsg: " << lerror;
        throw exception;
    }
    return (size_t) rval != 0 ? rval : size;
    return (size_t) rval;
}

size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){
@@ -218,7 +218,7 @@ RECVDATA:
        throw exception;
    }

    return (size_t) recvsize != 0 ? recvsize : size;
    return (size_t) recvsize;
}

void netplus::tcp::connect(socket *ssock){
+2 −2
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ size_t netplus::udp::sendData(void* data, unsigned long size, int flags) {
            << " ErrorMsg: " << GetLastError();
        throw exception;
    }
    return (size_t)rval == 0 ? size : rval;
    return (size_t)rval;
}

size_t netplus::udp::recvData(void* data, unsigned long size, int flags) {
@@ -201,7 +201,7 @@ size_t netplus::udp::recvData(void* data, unsigned long size, int flags) {
            << " ErrorMsg: " << GetLastError();
        throw exception;
    }
    return (size_t)recvsize == 0 ? size : recvsize;
    return (size_t)recvsize;
}
void netplus::udp::connect(socket* ssock) {
    NetException exception;