mirror of
https://github.com/open-goal/jak-project
synced 2026-05-30 08:56:59 -04:00
goalc: some minor fixes for tests
This commit is contained in:
@@ -32,9 +32,7 @@ class XSocketServer {
|
||||
int listening_socket = -1;
|
||||
std::vector<char> buffer;
|
||||
|
||||
bool kill_accept_thread = false;
|
||||
bool server_initialized = false;
|
||||
bool accept_thread_running = false;
|
||||
bool client_connected = false;
|
||||
|
||||
std::function<bool()> want_exit_callback;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -58,7 +58,6 @@ std::optional<std::string> 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;
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -105,8 +105,7 @@ int main(int argc, char** argv) {
|
||||
auto resp = repl_server.get_msg();
|
||||
if (resp) {
|
||||
std::lock_guard<std::mutex> 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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user