mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-14 13:21:13 +00:00
Enabled SO_REUSEADDR for server sockets.
This commit is contained in:
parent
084f888d14
commit
c1a0708089
@ -298,6 +298,7 @@ bool HttpServer::Start() {
|
||||
MHD_OPTION_UNESCAPE_CALLBACK,
|
||||
&HttpServer::HandleUnescape,
|
||||
this,
|
||||
MHD_OPTION_LISTENING_ADDRESS_REUSE, 1,
|
||||
MHD_OPTION_END);
|
||||
|
||||
this->running = (httpServer != nullptr);
|
||||
|
@ -175,6 +175,7 @@ void WebSocketServer::ThreadProc() {
|
||||
prefs::use_ipv6.c_str(), defaults::use_ipv6);
|
||||
|
||||
wss->init_asio();
|
||||
wss->set_reuse_addr(true);
|
||||
wss->set_message_handler(std::bind(&WebSocketServer::OnMessage, this, wss.get(), ::_1, ::_2));
|
||||
wss->set_open_handler(std::bind(&WebSocketServer::OnOpen, this, ::_1));
|
||||
wss->set_close_handler(std::bind(&WebSocketServer::OnClose, this, ::_1));
|
||||
|
Loading…
x
Reference in New Issue
Block a user