Location:
es_sock.h
Link against: esock.lib
RHostResolver
Supported from 5.0
Provides an interface to host name resolution services, such as DNS, that may be provided by particular protocol modules.
The interface provides functions to access the following facilities:
Obtaining names from addresses
Obtaining addresses from names
Getting and setting local host name
Note the following points before using this class:
Before using any service, a connection to a socket server session must be made.
Each function is available in both synchronous and asynchronous versions.
A single RHostResolver
can only perform one
request of any type at once. A client is panicked if it makes two
requests.
Not all actual services provide all these facilities. You should
also consult the documentation on the protocol you are intending to use.
Functions return KErrNotSupported
if the protocol does not support
a given operation. Note that a description of the protocol family name
resolution capabilities is available at run-time from
TProtocolDesc::iNamingServices
.
|
Defined in RHostResolver
:
Cancel()
, Close()
, GetByAddress()
, GetByName()
, GetHostName()
, Next()
, Open()
, SetHostName()
Inherited from RSubSessionBase
:
CloseSubSession()
,
CreateSubSession()
,
Send()
,
SendReceive()
,
SubSessionHandle()
,
operator=()
TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint aProtocol);
Initialises a name resolution service provided by a particular protocol. It must be called before other object functions are used.
|
|
void Close();
Closes a name resolution service. If a service has been opened
using Open()
, then it should be closed using Close()
.
This will ensure all associated resources are released.
TInt GetByAddress(const TSockAddr& anAddr,TNameEntry& aResult);
void GetByAddress(const TSockAddr& anAddr,TNameEntry& aResult,TRequestStatus& aStatus);
Gets the name of a host from its address.
|
|
TInt GetByName(const TDesC& aName,TNameEntry& aResult);
void GetByName(const TDesC& aName,TNameEntry& aResult,TRequestStatus& aStatus);
Resolves a machine name to a TSockAddress
.
|
|
TInt Next(TNameEntry& aResult);
void Next(TNameEntry& aResult,TRequestStatus& aStatus);
Returns the next answer. For some protocols, GetByName()
and GetByAddress()
may find more than one answer, for example if
aliases are allowed.
|
|
TInt GetHostName(TDes& aName);
void GetHostName(TDes& aName,TRequestStatus &aStatus);
Gets the name of the local host.
Note that with some protocols the name of the local host is not
necessarily known at all times. In some cases, a preceding call to
SetHostName()
must have been made.
|
|
TInt SetHostName(const TDesC& aName);
Sets the name of the local host.
|
|
void Cancel();
Cancels any outstanding asynchronous calls, which will return with error
code KErrCancel
.