Hi Jeff,
That does not work for me.
Only when I turn on "nscd" on my linux systems do things work reliably.
When nscd is not running most of the time I get the empty string.
Thanks,
Ernest
Jeff Hill wrote:
Dirk,
I think the IP address would be better than an empty string.
TBOMK, it does return the dotted IP address as a string if the DNS transaction hasn't completed yet. Let me know if that isn’t the case.
unsigned hostNameCache::getName (
char * pBuf, unsigned bufSize ) const
{
if ( bufSize == 0u ) {
return 0u;
}
epicsGuard < epicsMutex > guard ( this->mutex );
if ( this->nameLength > 0u ) {
if ( this->nameLength < bufSize ) {
strcpy ( pBuf, this->hostNameBuf );
return this->nameLength;
}
else {
unsigned reducedSize = bufSize - 1u;
strncpy ( pBuf, this->hostNameBuf, reducedSize );
pBuf [ reducedSize ] = '\0';
return reducedSize;
}
}
else {
osiSockAddr tmpAddr = this->dnsTransaction.address ();
return sockAddrToDottedIP ( &tmpAddr.sa, pBuf, bufSize );
}
}
Jeff
______________________________________________________
Jeffrey O. Hill Email [email protected]
LANL MS H820 Voice 505 665 1831
Los Alamos NM 87545 USA FAX 505 665 5107
Message content: TSPA
-----Original Message-----
From: Dirk Zimoch [mailto:[email protected]]
Sent: Wednesday, July 22, 2009 12:46 AM
To: Jeff Hill
Cc: [email protected]
Subject: Re: cainfo does display host info
Jeff Hill wrote:
I'm fully open to alternative suggestions.
I think the IP address would be better than an empty string.
--
Dr. Dirk Zimoch
Paul Scherrer Institut, WBGB/006
5232 Villigen PSI, Switzerland
Phone +41 56 310 5182
- Replies:
- RE: cainfo does display host info Jeff Hill
- References:
- cainfo does display host info Carl Schumann
- Re: cainfo does display host info Dirk Zimoch
- Re: cainfo does display host info Ralph Lange
- RE: cainfo does display host info Jeff Hill
- Re: cainfo does display host info Dirk Zimoch
- RE: cainfo does display host info Jeff Hill
- Navigate by Date:
- Prev:
RE: cainfo does display host info Jeff Hill
- Next:
Re: cainfo does display host info Andrew Johnson
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
<2009>
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: cainfo does display host info Jeff Hill
- Next:
RE: cainfo does display host info Jeff Hill
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
<2009>
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|