12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #ifndef NULLSOFT_WAC_NETWORK_ASYNCDNS_H
- #define NULLSOFT_WAC_NETWORK_ASYNCDNS_H
- #include "netinc.h"
- #include "wac_network_dns_api.h"
- struct cache_entry;
- namespace wa
- {
- namespace Components
- {
- class WAC_Network_AsyncDNS : public api_dns
- {
- public:
- WAC_Network_AsyncDNS( int max_cache_entries = 64 );
- ~WAC_Network_AsyncDNS();
- int resolve( const char *hostname, unsigned short port, addrinfo **addr, int sockettype );
- static int resolvenow( const char *hostname, unsigned short port, addrinfo **addr, int sockettype );
- private:
- cache_entry *m_cache;
- int m_cache_size;
- volatile int m_thread_kill;
- #ifdef _WIN32
- HANDLE m_thread;
- static unsigned long WINAPI _threadfunc( LPVOID _d );
- #else
- pthread_t m_thread;
- static unsigned int _threadfunc( void *_d );
- #endif
- void makesurethreadisrunning( void );
- protected:
- RECVS_DISPATCH;
- };
- }
- }
- #endif
|