diff --git a/common/cross_sockets/XSocketServer.h b/common/cross_sockets/XSocketServer.h index f1acbc9827..c9550ff391 100644 --- a/common/cross_sockets/XSocketServer.h +++ b/common/cross_sockets/XSocketServer.h @@ -32,9 +32,7 @@ class XSocketServer { int listening_socket = -1; std::vector buffer; - bool kill_accept_thread = false; bool server_initialized = false; - bool accept_thread_running = false; bool client_connected = false; std::function want_exit_callback; diff --git a/game/system/Deci2Server.cpp b/game/system/Deci2Server.cpp index 6951dc8443..02e71e8ec5 100644 --- a/game/system/Deci2Server.cpp +++ b/game/system/Deci2Server.cpp @@ -34,6 +34,8 @@ Deci2Server::~Deci2Server() { void Deci2Server::post_init() { fmt::print("[Deci2Server:{}] awaiting connections\n", tcp_port); + accept_thread_running = true; + kill_accept_thread = false; accept_thread = std::thread(&Deci2Server::accept_thread_func, this); } diff --git a/game/system/Deci2Server.h b/game/system/Deci2Server.h index 6cc8fd4539..52c73295a1 100644 --- a/game/system/Deci2Server.h +++ b/game/system/Deci2Server.h @@ -13,7 +13,6 @@ class Deci2Server : public XSocketServer { virtual ~Deci2Server(); void post_init() override; - void pre_shutdown() override; void read_data(); void send_data(void* buf, u16 len); @@ -32,6 +31,8 @@ class Deci2Server : public XSocketServer { int* d2_driver_count = nullptr; int accepted_socket = -1; + bool kill_accept_thread = false; + bool accept_thread_running = false; std::thread accept_thread; std::mutex server_mutex; diff --git a/goalc/compiler/nrepl/ReplServer.cpp b/goalc/compiler/nrepl/ReplServer.cpp index 2a39f114b3..ed12dc94a6 100644 --- a/goalc/compiler/nrepl/ReplServer.cpp +++ b/goalc/compiler/nrepl/ReplServer.cpp @@ -58,7 +58,6 @@ std::optional ReplServer::get_msg() { auto activity = select(max_sd + 1, &read_sockets, NULL, NULL, NULL); if (activity < 0) { // TODO - || error! - printf("Error at select(): %ld\n", WSAGetLastError()); return std::nullopt; } diff --git a/goalc/main.cpp b/goalc/main.cpp index 662a0021c8..0f5e6bf298 100644 --- a/goalc/main.cpp +++ b/goalc/main.cpp @@ -105,8 +105,7 @@ int main(int argc, char** argv) { auto resp = repl_server.get_msg(); if (resp) { std::lock_guard lock(compiler_mutex); - std::string copy = resp.value(); - status = compiler->handle_repl_string(copy); + status = compiler->handle_repl_string(resp.value()); // Print out the prompt, just for better UX compiler->print_to_repl(compiler->get_prompt()); }