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

test

parent 996b2a69
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -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>
@@ -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;
@@ -554,7 +563,6 @@ namespace netplus {
        for (auto* s : _ServerSockets) {
            if (!s) continue;
            s->bind();
            s->setNonBlock();
            s->listen();
            s->setTimeout(timeout);
        }