THostEntry encapsulates the attributes of a host (hostent).
int GetAddressCount()
Returns the number of pointers to addresses in the hostent (parent class of THostEntry).
ulong GetNthINetAddress(int nIndex=0)
An internet addressing -specific function.
THostEntry()
Constructor of THostEntry object. Initializes members describing host to 0.
The THostInfoManager class (and its friend class THostInfoWindow) encapsulate the Winsock database fu...
THostInfoManager()
This function initializes the hidden window.
int CancelHostRequest(HANDLE hTheHostRequest=0)
The caller can use this call to cancel the last pending request.
static int HostEntryToAddress(THostEntry *hEntry, char *szAddress)
Given a THostEntry*, this function converts it to a dotted-decimal szAddress.
int GetHostAddress(char *szHostAddress, const char *szHostName)
This function effectively converts szHostName to szHostAddress.
HANDLE HostRequest
Handle of host to get info about.
int LastError
Last error code.
bool HostRequestCompleted
Flag if host completed last request.
char HostInfoBuffer[MAXGETHOSTSTRUCT]
Used for calls to WSAAsync...()
int GetHostInfo(THostEntry *&hEntry, const TSocketAddress &sAddress)
The caller of this function supplies a pointer to be assigned by this function.
int GetHostName(char *name, int nameLength=N_MAX_HOST_NAME)
This function returns the name of the computer on which this program is running.
int GetHostInfoAsync(HANDLE &hTheHostRequest, TSocketAddress &sAddress)
The TheHostRequest parameter is returned to the caller with the asynchrous request handle.
THostInfoWindow HostWindow
Hidden window to catch notifications.
virtual ~THostInfoManager()
With this destructor, you need to clear any pending requests before the deletion.
void SetHostRequestCompleted(int error)
This function is called whenever an asynchronous request is completed.
A private class created by THostInfoManager to catch WinSock messages.
TResult DoNotification(TParam1, TParam2)
This is a relay function.
The TINetSocketAddress class encapsulates a Winsock Internet address.
The TSocketAddress class stores a Winsock socket address.
static struct hostent * gethostbyname(LPCSTR name)
static HANDLE WSAAsyncGetHostByAddr(HWND hWnd, uint msg, LPCSTR addr, int len, int type, char *buf, int bufLen)
static int gethostname(char *name, int nameLen)
static HANDLE WSAAsyncGetHostByName(HWND hWnd, uint msg, LPCSTR name, char *buf, int bufLen)
static struct hostent * gethostbyaddr(LPCSTR addr, int len, int type)
static int WSAGetLastError(void)
static int WSACancelAsyncRequest(HANDLE hTaskHandle)
static char * inet_ntoa(struct in_addr in)
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
virtual bool Create()
Creates the window interface element to be associated with this ObjectWindows interface element.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Object Windows Library (OWLNext Core)
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
General definitions used by all ObjectWindows programs.
#define STATIC_CAST(targetType, object)
#define EV_MESSAGE(message, method)
Response table entry for raw message handling Uses a dispatcher that just forwards WPARAM and LPARAM.
Main header of the Winsock OWL subsystem.
#define MSG_HOST_INFO_NOTIFY