diff --git a/SourceX/dvlnet/tcp_client.cpp b/SourceX/dvlnet/tcp_client.cpp index bfc32c557..8b76a0beb 100644 --- a/SourceX/dvlnet/tcp_client.cpp +++ b/SourceX/dvlnet/tcp_client.cpp @@ -39,7 +39,11 @@ int tcp_client::join(std::string addrstr, std::string passwd) game_init_info); send(*pkt); for (auto i = 0; i < no_sleep; ++i) { - poll(); + try { + poll(); + } catch (const std::runtime_error e) { + return -1; + } if (plr_self != PLR_BROADCAST) break; // join successful std::this_thread::sleep_for(std::chrono::milliseconds(ms_sleep));