diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index c380aa1a8..b95aaebce 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -506,8 +506,14 @@ void tcpiiu::shutdown () { LOCK ( this->pcas ); if ( this->state != iiu_disconnected ) { + int status; + this->state = iiu_disconnected; - ::shutdown ( this->sock, SD_BOTH ); + status = ::shutdown ( this->sock, SD_BOTH ); + if ( status ) { + errlogPrintf ("CAC TCP shutdown error was %s\n", + SOCKERRSTR (SOCKERRNO) ); + } cacRingBufferShutDown ( &this->send ); cacRingBufferShutDown ( &this->recv ); this->pcas->signalRecvActivityIIU ( *this ); diff --git a/src/ca/udpiiu.cpp b/src/ca/udpiiu.cpp index 8315df23d..f023fb1b3 100644 --- a/src/ca/udpiiu.cpp +++ b/src/ca/udpiiu.cpp @@ -585,7 +585,14 @@ udpiiu::~udpiiu () */ void udpiiu::shutdown () { - ::shutdown (this->sock, SD_BOTH); + int status; + + status = ::shutdown (this->sock, SD_BOTH); + if ( status ) { + errlogPrintf ( "CAC UDP shutdown error was %s\n", + SOCKERRSTR (SOCKERRNO) ); + } + this->shutdownCmd = true; semBinaryGive (this->xmitSignal); }