From 82079f43da12507b7c87bee22451864dd76fb1f6 Mon Sep 17 00:00:00 2001 From: Sergey Yagovtsev Date: Fri, 16 Sep 2016 22:23:04 +0300 Subject: [PATCH] linux client socket fix --- profiler_gui/main_window.cpp | 2 +- src/easy_socket.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/profiler_gui/main_window.cpp b/profiler_gui/main_window.cpp index e29f0e7..aa43502 100644 --- a/profiler_gui/main_window.cpp +++ b/profiler_gui/main_window.cpp @@ -121,7 +121,7 @@ EasyMainWindow::EasyMainWindow() : Parent(), m_treeWidget(nullptr), m_graphicsVi m_hostString->setInputMask("000.000.000.000;"); m_hostString->setValidator(®Validator); m_hostString->setText("127.0.0.1"); - m_hostString->setText("192.224.4.109"); + //m_hostString->setText("192.224.4.109"); fileToolBar->addWidget(m_hostString); diff --git a/src/easy_socket.cpp b/src/easy_socket.cpp index 3c68dc3..75fcc27 100644 --- a/src/easy_socket.cpp +++ b/src/easy_socket.cpp @@ -96,8 +96,11 @@ int EasySocket::connect() return -1; //fprintf(stderr,"ERROR, no such host\n"); } - - return ::connect(m_socket,(struct sockaddr *) &serv_addr,sizeof(serv_addr)); + int res = ::connect(m_socket,(struct sockaddr *) &serv_addr,sizeof(serv_addr)); + if(res == 0){ + m_replySocket = m_socket; + } + return res; } #else