aboutsummaryrefslogtreecommitdiff
path: root/dep/include/sockets/ResolvSocket.h
diff options
context:
space:
mode:
Diffstat (limited to 'dep/include/sockets/ResolvSocket.h')
-rw-r--r--dep/include/sockets/ResolvSocket.h78
1 files changed, 39 insertions, 39 deletions
diff --git a/dep/include/sockets/ResolvSocket.h b/dep/include/sockets/ResolvSocket.h
index ff4b1a5a982..2396af894de 100644
--- a/dep/include/sockets/ResolvSocket.h
+++ b/dep/include/sockets/ResolvSocket.h
@@ -1,6 +1,6 @@
/** \file ResolvSocket.h
- ** \date 2005-03-24
- ** \author grymse@alhem.net
+ ** \date 2005-03-24
+ ** \author grymse@alhem.net
**/
/*
Copyright (C) 2004-2007 Anders Hedstrom
@@ -8,7 +8,7 @@ Copyright (C) 2004-2007 Anders Hedstrom
This library is made available under the terms of the GNU GPL.
If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
+a separate license agreement is available. For information about
the closed-source license agreement for the C++ sockets library,
please visit http://www.alhem.net/Sockets/license.html and/or
email license@alhem.net.
@@ -40,58 +40,58 @@ namespace SOCKETS_NAMESPACE {
class Mutex;
-/** Async DNS resolver socket.
- \ingroup async */
+/** Async DNS resolver socket.
+ \ingroup async */
class ResolvSocket : public TcpSocket
{
- typedef std::map<std::string, /* type */
- std::map<std::string, std::string> > cache_t; /* host, result */
- typedef std::map<std::string, /* type */
- std::map<std::string, time_t> > timeout_t; /* host, time */
+ typedef std::map<std::string, /* type */
+ std::map<std::string, std::string> > cache_t; /* host, result */
+ typedef std::map<std::string, /* type */
+ std::map<std::string, time_t> > timeout_t; /* host, time */
public:
- ResolvSocket(ISocketHandler&);
- ResolvSocket(ISocketHandler&, Socket *parent, const std::string& host, port_t port, bool ipv6 = false);
- ResolvSocket(ISocketHandler&, Socket *parent, ipaddr_t);
+ ResolvSocket(ISocketHandler&);
+ ResolvSocket(ISocketHandler&, Socket *parent, const std::string& host, port_t port, bool ipv6 = false);
+ ResolvSocket(ISocketHandler&, Socket *parent, ipaddr_t);
#ifdef ENABLE_IPV6
- ResolvSocket(ISocketHandler&, Socket *parent, in6_addr&);
+ ResolvSocket(ISocketHandler&, Socket *parent, in6_addr&);
#endif
- ~ResolvSocket();
+ ~ResolvSocket();
- void OnAccept() { m_bServer = true; }
- void OnLine(const std::string& line);
- void OnDetached();
- void OnDelete();
+ void OnAccept() { m_bServer = true; }
+ void OnLine(const std::string& line);
+ void OnDetached();
+ void OnDelete();
- void SetId(int x) { m_resolv_id = x; }
- int GetId() { return m_resolv_id; }
+ void SetId(int x) { m_resolv_id = x; }
+ int GetId() { return m_resolv_id; }
- void OnConnect();
+ void OnConnect();
#ifdef ENABLE_IPV6
- void SetResolveIpv6(bool x = true) { m_resolve_ipv6 = x; }
+ void SetResolveIpv6(bool x = true) { m_resolve_ipv6 = x; }
#endif
private:
- ResolvSocket(const ResolvSocket& s) : TcpSocket(s) {} // copy constructor
- ResolvSocket& operator=(const ResolvSocket& ) { return *this; } // assignment operator
-
- std::string m_query;
- std::string m_data;
- bool m_bServer;
- Socket *m_parent;
- int m_resolv_id;
- std::string m_resolv_host;
- port_t m_resolv_port;
- ipaddr_t m_resolv_address;
+ ResolvSocket(const ResolvSocket& s) : TcpSocket(s) {} // copy constructor
+ ResolvSocket& operator=(const ResolvSocket& ) { return *this; } // assignment operator
+
+ std::string m_query;
+ std::string m_data;
+ bool m_bServer;
+ Socket *m_parent;
+ int m_resolv_id;
+ std::string m_resolv_host;
+ port_t m_resolv_port;
+ ipaddr_t m_resolv_address;
#ifdef ENABLE_IPV6
- bool m_resolve_ipv6;
- in6_addr m_resolv_address6;
+ bool m_resolve_ipv6;
+ in6_addr m_resolv_address6;
#endif
- static cache_t m_cache;
- static timeout_t m_cache_to;
- static Mutex m_cache_mutex;
- bool m_cached;
+ static cache_t m_cache;
+ static timeout_t m_cache_to;
+ static Mutex m_cache_mutex;
+ bool m_cached;
};