From 9ba3d946498a43aab68e9269d3534eb5e5a99675 Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Tue, 9 Dec 2014 14:36:55 +0100 Subject: [PATCH] connection tear-down from sender thread --- src/remote/codec.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/remote/codec.cpp b/src/remote/codec.cpp index 67bb701..134a3d4 100644 --- a/src/remote/codec.cpp +++ b/src/remote/codec.cpp @@ -1242,7 +1242,11 @@ namespace epics { } // wait read thread to die - bac->_shutdownEvent.wait(); + // TODO rewise + // this timeout is needed where close() is initiated from the send thread, + // and not from the read thread as usualy - recv() does not exit until socket is not destroyed, + // which is done the internalDestroy() call below + bac->_shutdownEvent.wait(3.0); // call internal destroy bac->internalDestroy(); @@ -1449,7 +1453,7 @@ namespace epics { if (IS_LOGGABLE(logLevelDebug)) { LOG(logLevelDebug, - "TCP socket to %s closed.", + "TCP socket to %s is to be closed.", inetAddressToString(_socketAddress).c_str()); } }