llasynchostbyname.h

Go to the documentation of this file.
00001 
00029 #ifndef LL_LLASYNCHOSTBYNAME_H
00030 #define LL_LLASYNCHOSTBYNAME_H
00031 
00032 #if LL_WINDOWS
00033 //
00034 // Only implemented on Windows
00035 //
00036 
00037 #define LL_WM_HOST_RESOLVED      (WM_APP + 1)
00038 
00039 typedef void (*LLAsyncHostByNameCallback)(BOOL success, const LLString& domain_name, U32 ip, void*);
00040 
00041 class LLAsyncHostByName
00042 {
00043 public:
00044         LLAsyncHostByName();
00045         ~LLAsyncHostByName();
00046 
00047         BOOL    startRequest( const LLString& domain_name, LLAsyncHostByNameCallback callback, void* userdata );
00048         void    handleMessage( const MSG& msg );
00049 
00050         BOOL    isPendingRequest() { return (mRequestHandle != 0); }
00051         BOOL    cancelPendingRequest();
00052 
00053         static void     handleMessageCallback(const MSG& msg);
00054 private:
00055         HANDLE  mRequestHandle;
00056         char    mOutputBuffer[ MAXGETHOSTSTRUCT ];                      /*Flawfinder: ignore*/
00057 
00058         LLAsyncHostByNameCallback mCallback;
00059         void*   mUserdata;
00060         LLString mDomainName;
00061         
00062 };
00063 
00064 extern LLAsyncHostByName gAsyncHostByName;
00065 
00066 #else // LL_WINDOWS
00067 
00068 // MBW -- Replicate this object on top of the posix gethostbyname() API.
00069 // For now, it will be synchronous.
00070 
00071 #include "llstring.h"
00072 
00073 typedef void (*LLAsyncHostByNameCallback)(BOOL success, const LLString& domain_name, U32 ip, void*);
00074 
00075 class LLAsyncHostByName
00076 {
00077 public:
00078         LLAsyncHostByName();
00079         ~LLAsyncHostByName();
00080 
00081         BOOL    startRequest( const LLString& domain_name, LLAsyncHostByNameCallback callback, void* userdata );
00082 
00083         BOOL    isPendingRequest() { return FALSE; }
00084         BOOL    cancelPendingRequest();
00085 
00086 private:
00087 };
00088 
00089 extern LLAsyncHostByName gAsyncHostByName;
00090 
00091 #endif // !LL_WINDOWS
00092 
00093 #endif // LL_LLASYNCHOSTBYNAME_H

Generated on Thu Jul 1 06:08:19 2010 for Second Life Viewer by  doxygen 1.4.7