浏览代码

Enabled 'keepalive' option to detect dead connections

Ivan Savenko 1 年之前
父节点
当前提交
526ac9807b
共有 1 个文件被更改,包括 1 次插入0 次删除
  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;