Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/TNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,14 @@ void TNetwork::TCPServerMain() {
}
ip::tcp::endpoint ClientEp;
ip::tcp::socket ClientSocket = Acceptor.accept(ClientEp, ec);
if (ec) {
if (!ec) {
TConnection Conn { std::move(ClientSocket), ClientEp };
std::thread ID(&TNetwork::Identify, this, std::move(Conn));
ID.detach(); // TODO: Add to a queue and attempt to join periodically
}
else {
beammp_errorf("Failed to accept() new client: {}", ec.message());
continue;
}
TConnection Conn { std::move(ClientSocket), ClientEp };
std::thread ID(&TNetwork::Identify, this, std::move(Conn));
ID.detach();
} catch (const std::exception& e) {
beammp_errorf("Exception in accept routine: {}", e.what());
}
Expand Down
Loading