diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index 2df3072fa..d942ea455 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -359,7 +359,7 @@ void tcpiiu::recvBytes ( // because it reqires a callback lock which probably // isnt appropriate here char name[64]; - this->hostNameCacheInstance.hostName ( + this->hostNameCacheInstance.getName ( name, sizeof ( name ) ); errlogPrintf ( "Unexpected problem with CA circuit to" @@ -891,7 +891,7 @@ void tcpiiu::unresponsiveCircuitNotify ( if ( this->connectedList.count() ) { char hostNameTmp[128]; - this->hostName ( guard, hostNameTmp, sizeof ( hostNameTmp ) ); + this->getHostName ( guard, hostNameTmp, sizeof ( hostNameTmp ) ); genLocalExcep ( cbGuard, guard, this->cacRef, ECA_UNRESPTMO, hostNameTmp ); while ( nciu * pChan = this->connectedList.get () ) { @@ -1008,7 +1008,7 @@ void tcpiiu::show ( unsigned level ) const { epicsGuard < epicsMutex > locker ( this->mutex ); char buf[256]; - this->hostNameCacheInstance.hostName ( buf, sizeof ( buf ) ); + this->hostNameCacheInstance.getName ( buf, sizeof ( buf ) ); ::printf ( "Virtual circuit to \"%s\" at version V%u.%u state %u\n", buf, CA_MAJOR_PROTOCOL_REVISION, this->minorProtocolVersion, this->state ); @@ -1699,21 +1699,19 @@ void tcpiiu::requestRecvProcessPostponedFlush ( this->recvProcessPostponedFlush = true; } -void tcpiiu::hostName ( +unsigned tcpiiu::getHostName ( epicsGuard < epicsMutex > & guard, - char *pBuf, unsigned bufLength ) const + char * pBuf, unsigned bufLength ) const throw () { guard.assertIdenticalMutex ( this->mutex ); - this->hostNameCacheInstance.hostName ( pBuf, bufLength ); + return this->hostNameCacheInstance.getName ( pBuf, bufLength ); } const char * tcpiiu::pHostName ( epicsGuard < epicsMutex > & guard ) const { guard.assertIdenticalMutex ( this->mutex ); - static char nameBuf [128]; - this->hostName ( guard, nameBuf, sizeof ( nameBuf ) ); - return nameBuf; + return this->hostNameCacheInstance.pointer (); } void tcpiiu::disconnectAllChannels ( diff --git a/src/ca/udpiiu.cpp b/src/ca/udpiiu.cpp index 3109263ba..e74264328 100644 --- a/src/ca/udpiiu.cpp +++ b/src/ca/udpiiu.cpp @@ -1127,11 +1127,11 @@ double udpiiu::getRTTE () const return epicsMax ( this->rtteMean, minRoundTripEstimate ); } -void udpiiu::hostName ( +unsigned udpiiu::getHostName ( epicsGuard < epicsMutex > & cacGuard, - char *pBuf, unsigned bufLength ) const + char *pBuf, unsigned bufLength ) const throw () { - netiiu::hostName ( cacGuard, pBuf, bufLength ); + return netiiu::getHostName ( cacGuard, pBuf, bufLength ); } const char * udpiiu::pHostName ( diff --git a/src/ca/udpiiu.h b/src/ca/udpiiu.h index b6fb8cfdf..94cf9b7df 100644 --- a/src/ca/udpiiu.h +++ b/src/ca/udpiiu.h @@ -177,9 +177,9 @@ private: const osiSockAddr &net_addr, const epicsTime & ); // netiiu stubs - void hostName ( + unsigned getHostName ( epicsGuard < epicsMutex > &, char * pBuf, - unsigned bufLength ) const; + unsigned bufLength ) const throw (); const char * pHostName ( epicsGuard < epicsMutex > & ) const; bool ca_v41_ok ( diff --git a/src/ca/virtualCircuit.h b/src/ca/virtualCircuit.h index 38a9c3fd2..daaf31fa6 100644 --- a/src/ca/virtualCircuit.h +++ b/src/ca/virtualCircuit.h @@ -148,9 +148,9 @@ public: bool ca_v49_ok ( epicsGuard < epicsMutex > & ) const; - void hostName ( + unsigned getHostName ( epicsGuard < epicsMutex > &, - char *pBuf, unsigned bufLength ) const; + char *pBuf, unsigned bufLength ) const throw (); bool alive ( epicsGuard < epicsMutex > & ) const; bool connecting (