From 7363d6a125c3a98df30555502b4ec48ea6c59b5a Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 8 Aug 2001 23:51:33 +0000 Subject: [PATCH] o increse stack size for threads calling call backs o use shutdown() to knock threads out of recv(), but will this work on Solaris ? The above change reacts to bugs in XTNextEvent() when an fd that has been closed is registerd with XtAppAddInput --- src/ca/tcpiiu.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index 5e26eb271..3530b4307 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -461,7 +461,7 @@ tcpiiu::tcpiiu ( cac &cac, double connectionTimeout, } epicsThreadId tid = epicsThreadCreate ( "CAC-TCP-recv", priorityOfRecv, - epicsThreadGetStackSize ( epicsThreadStackMedium ), + epicsThreadGetStackSize ( epicsThreadStackBig ), cacRecvThreadTCP, this); if ( tid == 0 ) { this->printf ("CA: unable to create CA client receive thread\n"); @@ -586,14 +586,22 @@ void tcpiiu::forcedShutdown () SOCKERRSTR (SOCKERRNO) ); } - status = socket_close ( this->sock ); + status = ::shutdown ( this->sock, SD_BOTH ); if ( status ) { - errlogPrintf ("CAC TCP socket close error was %s\n", - SOCKERRSTR (SOCKERRNO) ); - } - else { + errlogPrintf ("CAC TCP socket shutdown error was %s\n", + SOCKERRSTR (SOCKERRNO) ); + status = socket_close ( this->sock ); + if ( status ) { + errlogPrintf ("CAC TCP socket close error was %s\n", + SOCKERRSTR (SOCKERRNO) ); + } + else { + this->state = iiu_disconnected; + this->sockCloseCompleted = true; + } + } + else { this->state = iiu_disconnected; - this->sockCloseCompleted = true; } }