[prev in list] [next in list] [prev in thread] [next in thread] 

List:       drill-commits
Subject:    [11/16] git commit: DRILL-1045: C++ Client Properly shutdown sockets
From:       jacques () apache ! org
Date:       2014-06-26 20:45:11
Message-ID: fb82fe0b89cd4554af7a81f5bdf6ef4f () git ! apache ! org
[Download RAW message or body]

DRILL-1045: C++ Client Properly shutdown sockets


Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/69a07888
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/69a07888
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/69a07888

Branch: refs/heads/master
Commit: 69a07888f5629b9871d4d2214926c1643706572f
Parents: a299123
Author: norrislee <norrislee18@hotmail.com>
Authored: Thu Jun 19 18:12:25 2014 -0700
Committer: Jacques Nadeau <jacques@apache.org>
Committed: Wed Jun 25 17:55:54 2014 -0700

----------------------------------------------------------------------
 contrib/native/client/src/clientlib/drillClientImpl.cpp | 2 ++
 contrib/native/client/src/clientlib/drillClientImpl.hpp | 4 ++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/69a07888/contrib/native/client/src/clientlib/drillClientImpl.cpp
                
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.cpp \
b/contrib/native/client/src/clientlib/drillClientImpl.cpp index 71c2f78..6a29d88 \
                100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.cpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.cpp
@@ -229,6 +229,8 @@ void DrillClientImpl::handleHShakeReadTimeout(const \
boost::system::error_code &  // The deadline has passed.
             m_deadlineTimer.expires_at(boost::posix_time::pos_infin);
             DRILL_LOG(LOG_TRACE) << "Deadline timer expired."  << std::endl;
+            boost::system::error_code ignorederr;
+            m_socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, \
ignorederr);  m_socket.close();
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/69a07888/contrib/native/client/src/clientlib/drillClientImpl.hpp
                
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.hpp \
b/contrib/native/client/src/clientlib/drillClientImpl.hpp index 23e0ef6..2bf7b5c \
                100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.hpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.hpp
@@ -194,6 +194,8 @@ class DrillClientImpl{
 
             m_deadlineTimer.cancel();
             m_io_service.stop();
+            boost::system::error_code ignorederr;
+            m_socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, \
ignorederr);  m_socket.close();
             if(m_rbuf!=NULL){
                 Utils::freeBuffer(m_rbuf); m_rbuf=NULL;
@@ -304,6 +306,8 @@ inline bool DrillClientImpl::Active() {
 inline void DrillClientImpl::Close() {
     //TODO: cancel pending query
     if(this->m_bIsConnected){
+        boost::system::error_code ignorederr;
+        m_socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ignorederr);
         m_socket.close();
         m_bIsConnected=false;
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic