|
||
class RHostResolver : public RSubSessionBase;
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.
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
.
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.
RSubSessionBase
-
Client-side handle to a sub-session.
RHostResolver
- Provides an interface to host name resolution services, such as DNS, that may be...
Defined in RHostResolver
:
Cancel()
Cancels any outstanding asynchronous calls, which will return with error code KE...Close()
Closes a name resolution service. If a service has been opened using RHostResolv...GetByAddress(const TSockAddr &,TNameEntry &)
Get host by address (as get by name)GetByAddress(const TSockAddr &,TNameEntry &,TRequestStatus &)
Get host by address (as get by name)GetByName(const TDesC &,TNameEntry &)
Resolves a machine name to a TSockAddress.GetByName(const TDesC &,TNameEntry &,TRequestStatus &)
Resolves a machine name to a TSockAddress asynchronously.GetHostName(TDes &)
Gets the name of the local host.GetHostName(TDes &,TRequestStatus &)
Gets the name of the local host asynchronously.Next(TNameEntry &)
Get the next response if there is more than one response for a given host name (...Next(TNameEntry &,TRequestStatus &)
Get the next response if there is more than one response for a given host name (...Open(RSocketServ &,TUint,TUint)
Initialises a name resolution service provided by a particular protocol.Open(RSocketServ &,TUint,TUint,RConnection &)
Initialises a name resolution service provided by a particular protocol, and ass...Query(const TDesC8 &,TDes8 &)
Protocol - independent query. Synchronous version.Query(const TDesC8 &,TDes8 &,TRequestStatus &)
Protocol - independent query. Asynchronous version.QueryGetNext(TDes8 &)
Get the next query result. For some queries there can be more than one results. ...QueryGetNext(TDes8 &,TRequestStatus &)
Get the next query result. For some queries there can be more than one results. ...SetHostName(const TDesC &)
Sets the name of the local host. Inherited from RSubSessionBase
:
CloseSubSession(TInt)
Closes the sub-session.CreateAutoCloseSubSession(RSessionBase &,TInt,const TIpcArgs &)
Creates a new sub-session within an existing session. The new sub-session takes ...CreateSubSession(const RSessionBase &,TInt)
Creates a new sub-session within an existing session.CreateSubSession(const RSessionBase &,TInt,const TIpcArgs &)
Creates a new sub-session within an existing session.Send(TInt)const
Sends a blind message to the server - no reply is expected.Send(TInt,const TIpcArgs &)const
Sends a blind message to the server - no reply is expected.SendReceive(TInt)const
Sends a message to the server and waits synchronously for a reply.SendReceive(TInt,TRequestStatus &)const
Sends a message to the server and waits asynchronously for the reply.SendReceive(TInt,const TIpcArgs &)const
Sends a message to the server and waits synchronously for a reply.SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
Sends a message to the server and waits asynchronously for the reply.Session()const
Returns a copy of the session associated with this sub-session.SubSessionHandle()const
Gets the sub-session handle number.IMPORT_C TInt Open(RSocketServ &aSocketServer, TUint anAddrFamily, TUint aProtocol);
Initialises a name resolution service provided by a particular protocol.
This must be called before other object functions are used.
|
|
IMPORT_C TInt Open(RSocketServ &aSocketServer, TUint anAddrFamily, TUint aProtocol, RConnection &aConnection);
Initialises a name resolution service provided by a particular protocol, and associates the service with the same interface
as an existing RConnection
instance.
This must be called before other object functions are used.
Note that the association is instantaneous, in that the Host Resolver is associated with the interface that the RConnection
is associated with at the present time. This association terminates when the underlying interface goes down.
|
|
IMPORT_C void GetByName(const TDesC &aName, TNameEntry &aResult, TRequestStatus &aStatus);
Resolves a machine name to a TSockAddress asynchronously.
The server will fill in the supplied TNameEntry.
|
Capability: | Dependent | on the type of connection so deferred to PRT |
IMPORT_C TInt GetByName(const TDesC &aName, TNameEntry &aResult);
Resolves a machine name to a TSockAddress.
The server will fill in the supplied TNameEntry.
|
|
IMPORT_C void Next(TNameEntry &aResult, TRequestStatus &aStatus);
Get the next response if there is more than one response for a given host name (alias list)
Returns the next answer asynchronously, where there is more than one response for a given host name.
For some protocols, RHostResolver::GetByName(const TDesC &,TNameEntry &,TRequestStatus &)
and RHostResolver::GetByAddress(const TSockAddr &,TNameEntry &,TRequestStatus &)
may find more than one answer, for example if aliases are allowed.
|
IMPORT_C TInt Next(TNameEntry &aResult);
Get the next response if there is more than one response for a given host name (alias list)
Returns the next answer where there is more than one response for a given host name.
For some protocols, RHostResolver::GetByName(const TDesC &,TNameEntry &,TRequestStatus &)
and RHostResolver::GetByAddress(const TSockAddr &,TNameEntry &,TRequestStatus &)
may find more than one answer, for example if aliases are allowed.
|
|
Capability: | Dependent | on the type of connection so deferred to PRT |
IMPORT_C void GetByAddress(const TSockAddr &anAddr, TNameEntry &aResult, TRequestStatus &aStatus);
Get host by address (as get by name)
Gets the name of a host from its address asynchronously
|
Capability: | Dependent | on the type of connection so deferred to PRT |
IMPORT_C TInt GetByAddress(const TSockAddr &anAddr, TNameEntry &aResult);
Get host by address (as get by name)
Gets the name of a host from its address
|
|
Capability: | Dependent | on the type of connection so deferred to PRT |
IMPORT_C TInt GetHostName(TDes &aName);
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 RHostResolver::SetHostName(const TDesC &)
must have been made.
|
|
Capability: | Dependent | on the type of connection so deferred to PRT |
IMPORT_C void GetHostName(TDes &aName, TRequestStatus &aStatus);
Gets the name of the local host asynchronously.
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 RHostResolver::SetHostName(const TDesC &)
must have been made.
|
Capability: | NetworkControl | Service restricting and stored at protocol level |
IMPORT_C TInt SetHostName(const TDesC &aName);
Sets the name of the local host.
|
|
IMPORT_C void Close();
Closes a name resolution service. If a service has been opened using RHostResolver::Open(RSocketServ &,TUint,TUint)
, then it should be closed using RHostResolver::Close()
. This will ensure all associated resources are released.
IMPORT_C void Cancel();
Cancels any outstanding asynchronous calls, which will return with error code KErrCancel.
Capability: | Dependent | on the type of connection so deferred to PRT |
IMPORT_C void Query(const TDesC8 &aQuery, TDes8 &aResult, TRequestStatus &aStatus);
Protocol - independent query. Asynchronous version.
|
Capability: | Dependent | on the type of connection so deferred to PRT |
IMPORT_C TInt Query(const TDesC8 &aQuery, TDes8 &aResult);
Protocol - independent query. Synchronous version.
|
|
IMPORT_C void QueryGetNext(TDes8 &aResult, TRequestStatus &aStatus);
Get the next query result. For some queries there can be more than one results. Asynchronous version.
|
IMPORT_C TInt QueryGetNext(TDes8 &aResult);
Get the next query result. For some queries there can be more than one results. Synchronous version.
|
|