mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Networking: Set SO_REUSEADDR on *nix platforms
This commit is contained in:
@@ -84,6 +84,15 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
|
||||
_acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true), errorCode);
|
||||
if (errorCode)
|
||||
{
|
||||
TC_LOG_INFO("network", "Failed to set reuse_address option on acceptor %s", errorCode.message().c_str());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
_acceptor.bind(_endpoint, errorCode);
|
||||
if (errorCode)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,10 @@ void TCSoapThread(const std::string& host, uint16 port)
|
||||
soap_set_imode(&soap, SOAP_C_UTFSTRING);
|
||||
soap_set_omode(&soap, SOAP_C_UTFSTRING);
|
||||
|
||||
#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
|
||||
soap.bind_flags = SO_REUSEADDR;
|
||||
#endif
|
||||
|
||||
// check every 3 seconds if world ended
|
||||
soap.accept_timeout = 3;
|
||||
soap.recv_timeout = 5;
|
||||
|
||||
Reference in New Issue
Block a user