1 #ifndef __ARC_HOSTNAMERESOLVER_H__ 2 #define __ARC_HOSTNAMERESOLVER_H__ 10 #include <sys/socket.h> 34 int Family()
const {
return family; }
35 sockaddr
const* Addr()
const {
return addr; }
36 socklen_t Length()
const {
return length; }
54 int hr_resolve(std::string
const& node, std::string
const& service,
bool local, std::list<SockAddr>& addrs);
58 operator bool(
void) {
return (hostname_resolver_ != NULL); };
60 bool operator!(
void) {
return (hostname_resolver_ == NULL); };
65 Run* hostname_resolver_;
99 void SetMin(
unsigned int val);
101 void SetMax(
unsigned int val);
106 std::list<HostnameResolver*> hrs_;
107 void KeepRange(
void);
112 #endif // __ARC_HOSTNAMERESOLVER_H__ Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
bool operator!(void)
Returns true if this instance is not in useful condition.
Definition: HostnameResolver.h:60
HostnameResolverContainer(void)
Creates container with number of stored objects between 1 and 10.
void Release(HostnameResolver *hr)
Returns object into container.
Definition: HostnameResolver.h:27
Container for shared HostnameResolver objects.
Definition: HostnameResolver.h:81
HostnameResolver(void)
New HostnameResolver object.
static void Release(HostnameResolver *fa)
Destructor which returns object into global cache.
~HostnameResolverContainer(void)
Destroys container and all stored objects.
HostnameResolver * Acquire(void)
Get object from container.
static HostnameResolver * Acquire(void)
Constructor which takes already existing object from global cache.
int geterrno()
Get errno of last operation. Every operation resets errno.
Definition: HostnameResolver.h:56
Defines interface for accessing filesystems.
Definition: HostnameResolver.h:23
void SetMin(unsigned int val)
Adjust minimal number of stored objects.
void SetMax(unsigned int val)
Adjust maximal number of stored objects.
bool ping(void)
Check if communication with proxy works.
static void testtune(void)
Special method for using in unit tests.
int hr_resolve(std::string const &node, std::string const &service, bool local, std::list< SockAddr > &addrs)
Performs resolution of provided host name.
~HostnameResolver(void)
Shuts down any spawned executable.
This class runs an external executable.
Definition: Run.h:19