added host name pointer function

This commit is contained in:
Jeff Hill
2000-06-27 23:08:04 +00:00
parent 69162db301
commit 66b35e578b
6 changed files with 50 additions and 60 deletions

View File

@@ -89,14 +89,16 @@ unsigned cacChannelIO::readSequence () const
void cacChannelIO::hostName ( char *pBuf, unsigned bufLength ) const
{
if ( bufLength ) {
int status = gethostname ( pBuf, bufLength );
if ( status ) {
strncpy ( pBuf, "<unknown host>", bufLength );
pBuf[ bufLength - 1u ] = '\0';
}
localHostNameAtLoadTime.copy (pBuf, bufLength );
}
}
// deprecated - please do not use
const char * cacChannelIO::pHostName () const
{
return localHostNameAtLoadTime.pointer ();
}
void cacChannelIO::incrementOutstandingIO ()
{
}
@@ -104,3 +106,5 @@ void cacChannelIO::incrementOutstandingIO ()
void cacChannelIO::decrementOutstandingIO ()
{
}