Browse Source

Enabled 'keepalive' option to detect dead connections

Ivan Savenko 1 year ago
parent
commit
526ac9807b
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lib/network/NetworkConnection.cpp

+ 1 - 0
lib/network/NetworkConnection.cpp

@@ -17,6 +17,7 @@ NetworkConnection::NetworkConnection(INetworkConnectionListener & listener, cons
 	, listener(listener)
 {
 	socket->set_option(boost::asio::ip::tcp::no_delay(true));
+	socket->set_option(boost::asio::socket_base::keep_alive(true));
 
 	// iOS throws exception on attempt to set buffer size
 	constexpr auto bufferSize = 4 * 1024 * 1024;