mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-04 00:36:14 +00:00
fix some missing declaration
This commit is contained in:
parent
5e4c7eac51
commit
4ff69528bd
@ -157,12 +157,12 @@ void TNetwork::TCPServerMain() {
|
|||||||
// set timeout
|
// set timeout
|
||||||
size_t SendTimeoutMS = 30 * 1000;
|
size_t SendTimeoutMS = 30 * 1000;
|
||||||
#if defined(BEAMMP_WINDOWS)
|
#if defined(BEAMMP_WINDOWS)
|
||||||
ret = ::setsockopt(client.Socket, SOL_SOCKET, SO_SNDTIMEO, reinterpret_cast<const char*>(&ms), sizeof(ms));
|
int ret = ::setsockopt(client.Socket, SOL_SOCKET, SO_SNDTIMEO, reinterpret_cast<const char*>(&ms), sizeof(ms));
|
||||||
#else // POSIX
|
#else // POSIX
|
||||||
struct timeval optval;
|
struct timeval optval;
|
||||||
optval.tv_sec = (int)(SendTimeoutMS / 1000);
|
optval.tv_sec = (int)(SendTimeoutMS / 1000);
|
||||||
optval.tv_usec = (SendTimeoutMS % 1000) * 1000;
|
optval.tv_usec = (SendTimeoutMS % 1000) * 1000;
|
||||||
ret = ::setsockopt(client.Socket, SOL_SOCKET, SO_SNDTIMEO, reinterpret_cast<void*>(&optval), sizeof(optval));
|
int ret = ::setsockopt(client.Socket, SOL_SOCKET, SO_SNDTIMEO, reinterpret_cast<void*>(&optval), sizeof(optval));
|
||||||
#endif
|
#endif
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
throw std::runtime_error("setsockopt recv timeout: " + GetPlatformAgnosticErrorString());
|
throw std::runtime_error("setsockopt recv timeout: " + GetPlatformAgnosticErrorString());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user