From 750a36c3d10683678fc36794f70c3a33679ba452 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nicolas.pope@utu.fi>
Date: Mon, 9 May 2022 09:10:48 +0100
Subject: [PATCH] Another WSPoll fix attempt

---
 src/universe.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/universe.cpp b/src/universe.cpp
index e0d4feb..3599226 100644
--- a/src/universe.cpp
+++ b/src/universe.cpp
@@ -468,7 +468,7 @@ void Universe::_run() {
 	auto start = std::chrono::high_resolution_clock::now();
 
 	while (active_) {
-		SOCKET n = _setDescriptors();
+		_setDescriptors();
 		int selres = 1;
 
 		_cleanupPeers();
@@ -482,7 +482,7 @@ void Universe::_run() {
 		}
 
 		// It is an error to use "select" with no sockets ... so just sleep
-		if (n == 0) {
+		if (impl_->pollfds.size() == 0) {
 			std::shared_lock lk(net_mutex_);
 			socket_cv_.wait_for(lk, std::chrono::milliseconds(100), [this](){ return listeners_.size() > 0 || connection_count_ > 0; });
 			continue;
-- 
GitLab