From 7741f6b45c2a65e3a0833a614729dd164b1d565b Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 15 Jun 2000 21:47:20 +0000 Subject: [PATCH] added shutdown () sys call diagnostics --- src/ca/tcpiiu.cpp | 8 +++++++- src/ca/udpiiu.cpp | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) 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); }