mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 15:26:59 +00:00
- add 120 seconds timeout
This commit is contained in:
parent
688e46f524
commit
4b30918659
@ -11,6 +11,8 @@
|
||||
#include <boost/asio/ip/address_v4.hpp>
|
||||
#include <cstring>
|
||||
|
||||
typedef boost::asio::detail::socket_option::integer<SOL_SOCKET, SO_RCVTIMEO> rcv_timeout_option;
|
||||
|
||||
std::vector<uint8_t> StringToVector(const std::string& Str) {
|
||||
return std::vector<uint8_t>(Str.data(), Str.data() + Str.size());
|
||||
}
|
||||
@ -151,6 +153,7 @@ void TNetwork::TCPServerMain() {
|
||||
if (ec) {
|
||||
beammp_errorf("failed to accept: {}", ec.message());
|
||||
}
|
||||
ClientSocket.set_option(rcv_timeout_option{ 120000 }); //timeout of 120seconds
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user