eliminate disconnect message from ca_task_exit

This commit is contained in:
Jeff Hill
2002-09-11 20:54:40 +00:00
parent abcbaeca9c
commit 761a87ea73
10 changed files with 25 additions and 173 deletions

View File

@@ -69,7 +69,6 @@ LIBSRCS += comQueSend.cpp
LIBSRCS += comBuf.cpp
LIBSRCS += hostNameCache.cpp
LIBSRCS += msgForMultiplyDefinedPV.cpp
LIBSRCS += limboiiu.cpp
LIBSRCS += callbackMutex.cpp
LIBSRCS += templateInstances.cpp

View File

@@ -243,10 +243,12 @@ cac::~cac ()
// shutdown all tcp circuits
//
{
epicsGuard < callbackMutex > cbGuard ( this->cbMutex );
epicsGuard < cacMutex > guard ( this->mutex );
resTableIter < tcpiiu, caServerID > iter = this->serverTable.firstIter ();
while ( iter.valid() ) {
iter->initiateCleanShutdown ( guard );
// this causes a clean shutdown to occur
iter->removeAllChannels ( cbGuard, guard, *this );
iter++;
}
}

View File

@@ -126,6 +126,7 @@ public:
virtual ~cacChannelNotify () = 0;
virtual void connectNotify () = 0;
virtual void disconnectNotify () = 0;
virtual void serviceShutdownNotify () = 0;
virtual void accessRightsNotify ( const caAccessRights & ) = 0;
virtual void exception ( int status, const char *pContext ) = 0;
// we should probably have a different vf for each type of exception ????

View File

@@ -1,129 +0,0 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* $Id$
*
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
* Copyright, 1986, The Regents of the University of California.
*
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*/
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
#define epicsExportSharedSymbols
#include "iocinf.h"
#include "netiiu.h"
#include "inetAddrID.h"
limboiiu::limboiiu ()
{
}
void limboiiu::hostName ( char *pBuf, unsigned bufLength ) const
{
netiiu::hostName ( pBuf, bufLength );
}
const char * limboiiu::pHostName () const
{
return netiiu::pHostName ();
}
bool limboiiu::ca_v42_ok () const
{
return netiiu::ca_v42_ok ();
}
void limboiiu::writeRequest ( epicsGuard < cacMutex > & guard, nciu & chan, unsigned type,
unsigned nElem, const void * pValue )
{
netiiu::writeRequest ( guard, chan, type, nElem, pValue );
}
void limboiiu::writeNotifyRequest ( epicsGuard < cacMutex > & guard, nciu & chan,
netWriteNotifyIO & io, unsigned type, unsigned nElem, const void *pValue )
{
netiiu::writeNotifyRequest ( guard, chan, io, type, nElem, pValue );
}
void limboiiu::readNotifyRequest ( epicsGuard < cacMutex > & guard, nciu & chan,
netReadNotifyIO & io, unsigned type, unsigned nElem )
{
netiiu::readNotifyRequest ( guard, chan, io, type, nElem );
}
void limboiiu::clearChannelRequest ( epicsGuard < cacMutex > & guard,
ca_uint32_t sid, ca_uint32_t cid )
{
netiiu::clearChannelRequest ( guard, sid, cid );
}
void limboiiu::subscriptionRequest ( epicsGuard < cacMutex > & guard, nciu & chan,
netSubscription & subscr )
{
netiiu::subscriptionRequest ( guard, chan, subscr );
}
void limboiiu::subscriptionCancelRequest ( epicsGuard < cacMutex > & guard,
nciu & chan, netSubscription & subscr )
{
netiiu::subscriptionCancelRequest ( guard, chan, subscr );
}
void limboiiu::flushRequest ()
{
netiiu::flushRequest ();
}
bool limboiiu::flushBlockThreshold ( epicsGuard < cacMutex > & guard ) const
{
return netiiu::flushBlockThreshold ( guard );
}
void limboiiu::flushRequestIfAboveEarlyThreshold ( epicsGuard < cacMutex > & guard )
{
netiiu::flushRequestIfAboveEarlyThreshold ( guard );
}
void limboiiu::blockUntilSendBacklogIsReasonable
( cacNotify & notify, epicsGuard < cacMutex > & guard )
{
netiiu::blockUntilSendBacklogIsReasonable ( notify, guard );
}
void limboiiu::requestRecvProcessPostponedFlush ()
{
netiiu::requestRecvProcessPostponedFlush ();
}
osiSockAddr limboiiu::getNetworkAddress () const
{
return netiiu::getNetworkAddress ();
}
void limboiiu::uninstallChan ( epicsGuard < cacMutex > & guard, nciu & chan )
{
netiiu::uninstallChan( guard, chan );
}

View File

@@ -79,6 +79,7 @@ public:
void * operator new ( size_t size );
void operator delete ( void *pCadaver, size_t size );
void beaconAnomalyNotify ();
void serviceShutdownNotify ();
void accessRightsStateChange ( const caAccessRights & );
ca_uint32_t getSID () const;
ca_uint32_t getCID () const;
@@ -100,7 +101,7 @@ public:
private:
caAccessRights accessRightState;
cac & cacCtx;
char * pNameStr;
const char * pNameStr;
netiiu * piiu;
ca_uint32_t sid; // server id
unsigned count;
@@ -214,6 +215,11 @@ inline const netiiu * nciu::getConstPIIU () const
return this->piiu;
}
inline void nciu::serviceShutdownNotify ()
{
this->notify().serviceShutdownNotify ();
}
inline cac & nciu::getClient ()
{
return this->cacCtx;

View File

@@ -68,35 +68,4 @@ public:
virtual void uninstallChan ( epicsGuard < cacMutex > &, nciu & ) = 0;
};
class limboiiu : public netiiu { // X aCC 655
public:
limboiiu ();
private:
void hostName ( char *pBuf, unsigned bufLength ) const;
const char * pHostName () const; // deprecated - please do not use
bool ca_v42_ok () const;
void writeRequest ( epicsGuard < cacMutex > &, nciu &,
unsigned type, unsigned nElem, const void *pValue );
void writeNotifyRequest ( epicsGuard < cacMutex > &, nciu &, netWriteNotifyIO &,
unsigned type, unsigned nElem, const void *pValue );
void readNotifyRequest ( epicsGuard < cacMutex > &, nciu &, netReadNotifyIO &,
unsigned type, unsigned nElem );
void clearChannelRequest ( epicsGuard < cacMutex > &,
ca_uint32_t sid, ca_uint32_t cid );
void subscriptionRequest ( epicsGuard < cacMutex > &, nciu &,
netSubscription &subscr );
void subscriptionCancelRequest ( epicsGuard < cacMutex > &,
nciu & chan, netSubscription & subscr );
void flushRequest ();
bool flushBlockThreshold ( epicsGuard < cacMutex > & ) const;
void flushRequestIfAboveEarlyThreshold ( epicsGuard < cacMutex > & );
void blockUntilSendBacklogIsReasonable
( cacNotify &, epicsGuard < cacMutex > & );
void requestRecvProcessPostponedFlush ();
osiSockAddr getNetworkAddress () const;
void uninstallChan ( epicsGuard < cacMutex > &, nciu & );
limboiiu ( const limboiiu & );
limboiiu & operator = ( const limboiiu & );
};
#endif // netiiuh

View File

@@ -99,6 +99,7 @@ private:
bool prevConnected;
void connectNotify ();
void disconnectNotify ();
void serviceShutdownNotify ();
void accessRightsNotify ( const caAccessRights & );
void exception ( int status, const char *pContext );
void readException ( int status, const char *pContext,

View File

@@ -150,6 +150,11 @@ void oldChannelNotify::disconnectNotify ()
}
}
void oldChannelNotify::serviceShutdownNotify ()
{
delete this;
}
void oldChannelNotify::accessRightsNotify ( const caAccessRights &ar )
{
struct access_rights_handler_args args;

View File

@@ -650,11 +650,6 @@ void tcpiiu::initiateAbortShutdown ( epicsGuard < callbackMutex > & cbGuard,
//
tcpiiu::~tcpiiu ()
{
{
epicsGuard < cacMutex > guard ( this->cacRef.mutexRef() );
this->initiateCleanShutdown ( guard );
}
this->sendThread.exitWait ();
this->recvThread.exitWait ();
@@ -1247,7 +1242,6 @@ void tcpiiu::removeAllChannels ( epicsGuard < callbackMutex > & cbGuard,
epicsGuard < cacMutex > & guard,
cacDisconnectChannelPrivate & dcp )
{
// we are protected here because channel delete takes the callback mutex
while ( nciu *pChan = this->channelList.first() ) {
// if the claim reply has not returned then we will issue
// the clear channel request to the server when the claim reply

View File

@@ -189,10 +189,14 @@ udpiiu::~udpiiu ()
{
this->shutdown ();
static limboiiu limboIIU;
while ( nciu * pChan = this->channelList.get () ) {
// no need to own CAC lock here because the channel is being decomissioned
pChan->disconnect ( limboIIU );
// no need to own CAC lock here because the CA context
// is being decomissioned
tsDLIter < nciu > chan = this->channelList.firstIter ();
while ( chan.valid () ) {
tsDLIter < nciu > next = chan;
next++;
chan->serviceShutdownNotify ();
chan = next;
}
// avoid use of ellFree because problems on windows occur if the