move patch servers to separate threads

This commit is contained in:
Martin Michelsen
2024-02-17 22:28:03 -08:00
parent 350a89f3da
commit 1d42faac3e
12 changed files with 920 additions and 521 deletions
+1 -2
View File
@@ -134,6 +134,7 @@ void Server::connect_client(
c->channel.on_command_received = Server::on_client_input;
c->channel.on_error = Server::on_client_error;
c->channel.context_obj = this;
this->state->channel_to_client.emplace(&c->channel, c);
server_log.info(
"Client connected: C-%" PRIX64 " on virtual connection %p via T-%hu-%s-%s-VI",
@@ -143,8 +144,6 @@ void Server::connect_client(
name_for_enum(version),
name_for_enum(initial_state));
this->state->channel_to_client.emplace(&c->channel, c);
// Manually set the remote address, since the bufferevent has no fd and the
// Channel constructor can't figure out the virtual remote address
auto* remote_sin = reinterpret_cast<sockaddr_in*>(&c->channel.remote_addr);