Loading src/event/iocp.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <atomic> #include <thread> #include <chrono> #include <vector> #include <memory> #include <mutex> Loading Loading @@ -220,15 +221,23 @@ namespace netplus { serverSock->accept(csock, false); } catch (NetException& e) { if (!event::Running) break; if (e.getErrorType() == NetException::Note) continue; if (e.getErrorType() == NetException::Note) { std::this_thread::sleep_for(std::chrono::milliseconds(1)); continue; } std::cerr << "accept failed: " << e.what() << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(10)); continue; } catch (...) { if (!event::Running) break; std::this_thread::sleep_for(std::chrono::milliseconds(10)); continue; } if (!csock) continue; if (!csock) { std::this_thread::sleep_for(std::chrono::milliseconds(1)); continue; } SOCKET accepted = csock->fd(); if (accepted == INVALID_SOCKET) continue; Loading Loading @@ -554,7 +563,6 @@ namespace netplus { for (auto* s : _ServerSockets) { if (!s) continue; s->bind(); s->setNonBlock(); s->listen(); s->setTimeout(timeout); } Loading Loading
src/event/iocp.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <atomic> #include <thread> #include <chrono> #include <vector> #include <memory> #include <mutex> Loading Loading @@ -220,15 +221,23 @@ namespace netplus { serverSock->accept(csock, false); } catch (NetException& e) { if (!event::Running) break; if (e.getErrorType() == NetException::Note) continue; if (e.getErrorType() == NetException::Note) { std::this_thread::sleep_for(std::chrono::milliseconds(1)); continue; } std::cerr << "accept failed: " << e.what() << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(10)); continue; } catch (...) { if (!event::Running) break; std::this_thread::sleep_for(std::chrono::milliseconds(10)); continue; } if (!csock) continue; if (!csock) { std::this_thread::sleep_for(std::chrono::milliseconds(1)); continue; } SOCKET accepted = csock->fd(); if (accepted == INVALID_SOCKET) continue; Loading Loading @@ -554,7 +563,6 @@ namespace netplus { for (auto* s : _ServerSockets) { if (!s) continue; s->bind(); s->setNonBlock(); s->listen(); s->setTimeout(timeout); } Loading