From 4c01c5cc55e5840ab91d6d51248b080b869f8c17 Mon Sep 17 00:00:00 2001 From: "michal.szwaj" Date: Wed, 4 Apr 2018 18:26:20 +0200 Subject: [PATCH] Set socket options to detect broken connection --- src/autoapp/UI/ConnectDialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/autoapp/UI/ConnectDialog.cpp b/src/autoapp/UI/ConnectDialog.cpp index 127e216..08b4f56 100644 --- a/src/autoapp/UI/ConnectDialog.cpp +++ b/src/autoapp/UI/ConnectDialog.cpp @@ -46,6 +46,8 @@ void ConnectDialog::onConnectButtonClicked() try { + tcpWrapper_.setKeepAliveOption(*socket, true); + tcpWrapper_.setNoDelayOption(*socket, true); tcpWrapper_.asyncConnect(*socket, ipAddress, 5277, std::bind(&ConnectDialog::connectHandler, this, std::placeholders::_1, ipAddress, socket)); } catch(const boost::system::system_error& se)