L_InetGetHostName

#include "l_bitmap.h"
#include "ltnet.h"

L_LTNET_API L_INT L_InetGetHostName(hHost, pszName, nType, pulBufferLength)

L_COMP hHost;

/* handle of remote computer */

L_CHAR * pszName;

/* address of buffer to update */

L_INT nType;

/* type of name to retrieve */

L_SIZE_T *pulBufferLength;

/* address of a variable to be updated with the length of pszName */

Gets either the descriptive name (URL) or the IP address of a remote computer.

Parameter

Description

hHost

Handle of the remote computer for which hostname should be retrieved

pszName

Address of the buffer to update with the hostname character string

nType

Value indicating the type of name to retrieve. Possible values include:

 

Value

Meaning

 

HOST_NAME_DESCRP

descriptive name of remote computer

 

HOST_NAME_IP

IP address of remote computer

pulBufferLength

Address of a variable to be updated with the required length of the buffer to hold the hostname string.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

hHost has to be connected for this function to return SUCCESS.

If pszName is NULL, then pulBufferLength will be updated with the required size of the buffer to hold the hostname string. The size will take into account the terminating NULL character.

If pszName is not NULL, then pulBufferLength contains the size of the string copied into pszName. The string will be truncated if the buffer pointed to by pszName is not large enough to contain the entire hostname string.

You must initialize the LEADTOOLS Peer-to-Peer DLL using L_InetStartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_InetConnect, L_InetServerInit, L_InetClose, L_InetStartUp, L_InetShutDown

Topics:

Peer-to-Peer Functions

Example

For an example, refer to L_InetConnect.