summaryrefslogtreecommitdiff
path: root/src/net/socket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/socket.cpp')
-rw-r--r--src/net/socket.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/net/socket.cpp b/src/net/socket.cpp
index a01cd81..fce45fb 100644
--- a/src/net/socket.cpp
+++ b/src/net/socket.cpp
@@ -34,10 +34,6 @@
#include "../io/cxxstdio.hpp"
-// TODO get rid of ordering violations
-#include "../mmo/utils.hpp"
-#include "../mmo/core.hpp"
-
#include "timer.hpp"
#include "../poison.hpp"
@@ -399,7 +395,7 @@ void realloc_fifo(Session *s, size_t rfifo_size, size_t wfifo_size)
}
}
-void do_sendrecv(interval_t next_ms)
+bool do_sendrecv(interval_t next_ms)
{
bool any = false;
io::FD_Set rfd = readfds, wfd;
@@ -419,9 +415,9 @@ void do_sendrecv(interval_t next_ms)
{
PRINTF("Shutting down - nothing to do\n"_fmt);
// TODO hoist this
- runflag = false;
+ return false;
}
- return;
+ return true;
}
struct timeval timeout;
{
@@ -431,7 +427,7 @@ void do_sendrecv(interval_t next_ms)
timeout.tv_usec = next_us.count();
}
if (io::FD_Set::select(fd_max, &rfd, &wfd, nullptr, &timeout) <= 0)
- return;
+ return true;
for (io::FD i : iter_fds())
{
Session *s = get_session(i);
@@ -451,9 +447,10 @@ void do_sendrecv(interval_t next_ms)
s->func_recv(s);
}
}
+ return true;
}
-void do_parsepacket(void)
+bool do_parsepacket(void)
{
for (io::FD i : iter_fds())
{
@@ -483,5 +480,6 @@ void do_parsepacket(void)
/// Reclaim buffer space for what was read
RFIFOFLUSH(s);
}
+ return true;
}
} // namespace tmwa