Chapter Contents |
Previous |
Next |
endhostent |
Portability: | UNIX compatible |
SYNOPSIS | |
DESCRIPTION | |
PORTABILITY | |
IMPLEMENTATION | |
RELATED FUNCTIONS |
SYNOPSIS |
#include <netdb.h> void endhostent(void);
DESCRIPTION |
endhostent
closes a host file or TCP connection.
endhostent
is a combination of the host file
and resolver versions of the BSD UNIX Socket Library
endhostent
.
In some instances, when the resolver is used to look
up the host name, a virtual circuit (that is, a TCP connection) is used to
communicate with the name server, based on the
RESOLVEVIA
statement in the TCPIP.DATA file or the
RES_USEVC
resolver option specified by your program.
In these cases, you can use the
RES_STAYOPEN
resolver option to maintain the connection with the name
server between queries.
endhostent
closes this connection. (See Bitwise OR Options for information about
RES_USEVC
and
RES_STAYOPEN
.)
In other instances,
the host file is used as a source
of host names. If the host file is opened with a
sethostent
call and the
stayopen
parameter is a nonzero value,
endhostent
closes the host file.
Refer to Network Administration for information on naming host files and the logic that determines whether the host file or the resolver is used for looking up names.
PORTABILITY |
The logic that determines whether to use
the host file or the resolver is not uniform across environments. At the
source code level, however,
endhostent
is portable to other environments, including most UNIX systems, that
implement BSD sockets.
IMPLEMENTATION |
endhostent
is a combination of the host file and resolver versions
of the BSD UNIX Socket Library
gethostbyaddr
.
RELATED FUNCTIONS |
sethostent
,
gethostent
,
gethostbyname
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.