Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
RHostResolver Class Reference

Provides an interface to host name resolution services, such as DNS, that may be provided by particular protocol modules. More...

#include <es_sock.h>

Inheritance diagram for RHostResolver:
RSubSessionBase

Public Member Functions

IMPORT_C TInt Open (RSocketServ &aSocketServer, TUint anAddrFamily, TUint aProtocol)
 Initialises a name resolution service provided by a particular protocol.
 
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.
 
IMPORT_C void GetByName (const TDesC &aName, TNameEntry &aResult, TRequestStatus &aStatus)
 Resolves a machine name to a TSockAddress asynchronously.
 
IMPORT_C TInt GetByName (const TDesC &aName, TNameEntry &aResult)
 Resolves a machine name to a TSockAddress.
 
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)
 
IMPORT_C TInt Next (TNameEntry &aResult)
 Get the next response if there is more than one response for a given host name (alias list)
 
IMPORT_C void GetByAddress (const TSockAddr &anAddr, TNameEntry &aResult, TRequestStatus &aStatus)
 Get host by address (as get by name)
 
IMPORT_C TInt GetByAddress (const TSockAddr &anAddr, TNameEntry &aResult)
 Get host by address (as get by name)
 
IMPORT_C TInt GetHostName (TDes &aName)
 Gets the name of the local host.
 
IMPORT_C void GetHostName (TDes &aName, TRequestStatus &aStatus)
 Gets the name of the local host asynchronously.
 
IMPORT_C TInt SetHostName (const TDesC &aName)
 
IMPORT_C void Close ()
 Closes a name resolution service.
 
IMPORT_C void Cancel ()
 Cancels any outstanding asynchronous calls, which will return with error code KErrCancel.
 
IMPORT_C void Query (const TDesC8 &aQuery, TDes8 &aResult, TRequestStatus &aStatus)
 Protocol - independent query.
 
IMPORT_C TInt Query (const TDesC8 &aQuery, TDes8 &aResult)
 Protocol - independent query.
 
IMPORT_C void QueryGetNext (TDes8 &aResult, TRequestStatus &aStatus)
 Get the next query result.
 
IMPORT_C TInt QueryGetNext (TDes8 &aResult)
 Get the next query result.
 
IMPORT_C TInt SetOpt (TUint anOptionName, TUint anOptionLevel, const TDesC8 &anOption=TPtrC8(NULL, 0))
 
- Public Member Functions inherited from RSubSessionBase
TInt SubSessionHandle () const
 Gets the sub-session handle number.
 

Additional Inherited Members

- Protected Member Functions inherited from RSubSessionBase
 RSubSessionBase ()
 Default constructor.
 
IMPORT_C const RSessionBase Session () const
 Returns a copy of the session associated with this sub-session.
 
TInt CreateSubSession (const RSessionBase &aSession, TInt aFunction, const TIpcArgs &aArgs)
 Creates a new sub-session within an existing session.
 
TInt CreateSubSession (const RSessionBase &aSession, TInt aFunction)
 Creates a new sub-session within an existing session.
 
IMPORT_C TInt CreateAutoCloseSubSession (RSessionBase &aSession, TInt aFunction, const TIpcArgs &aArgs)
 Creates a new sub-session within an existing session.
 
IMPORT_C void CloseSubSession (TInt aFunction)
 Closes the sub-session.
 
TInt Send (TInt aFunction, const TIpcArgs &aArgs) const
 Sends a blind message to the server - no reply is expected.
 
void SendReceive (TInt aFunction, const TIpcArgs &aArgs, TRequestStatus &aStatus) const
 Sends a message to the server and waits asynchronously for the reply.
 
TInt SendReceive (TInt aFunction, const TIpcArgs &aArgs) const
 Sends a message to the server and waits synchronously for a reply.
 
TInt Send (TInt aFunction) const
 Sends a blind message to the server - no reply is expected.
 
void SendReceive (TInt aFunction, TRequestStatus &aStatus) const
 Sends a message to the server and waits asynchronously for the reply.
 
TInt SendReceive (TInt aFunction) const
 Sends a message to the server and waits synchronously for a reply.
 

Detailed Description

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.

API status
Published to all clients. Released API.

Definition at line 971 of file es_sock.h.

Member Function Documentation

◆ Cancel()

IMPORT_C void RHostResolver::Cancel ( )

Cancels any outstanding asynchronous calls, which will return with error code KErrCancel.

(generated from Symbian Developer Library)

◆ Close()

IMPORT_C void RHostResolver::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.

(generated from Symbian Developer Library)

◆ GetByAddress() [1/2]

IMPORT_C TInt RHostResolver::GetByAddress ( const TSockAddr &  anAddr,
TNameEntry &  aResult 
)

Get host by address (as get by name)

Gets the name of a host from its address

Parameters
anAddrThe address to use
aResultReturns the result of the query. If more than one result is allowed by the protocol, the client can call Next() to find any further results.
capability
Dependent on the type of connection so deferred to PRT

(generated from Symbian Developer Library)

◆ GetByAddress() [2/2]

IMPORT_C void RHostResolver::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

Parameters
anAddrThe address to use
aResultOn return, the result of the query. If more than one result is allowed by the protocol, the client can call Next() to find any further results.
aStatusIndicates asynchronous operation and on completion contains an error code: see the system-wide error codes.
capability
Dependent on the type of connection so deferred to PRT

(generated from Symbian Developer Library)

◆ GetByName() [1/2]

IMPORT_C TInt RHostResolver::GetByName ( const TDesC &  aName,
TNameEntry &  aResult 
)

Resolves a machine name to a TSockAddress.

The server will fill in the supplied TNameEntry.

Parameters
aNameThe name to resolve. The format of the name and any wild-cards supported, along with any separators in hierarchical name systems, are protocol specific
aResultOn return, the result of the name resolution. If more than one result is allowed by the protocol, the client can call Next() to find any further results.
capability
Dependent on the type of connection so deferred to PRT

(generated from Symbian Developer Library)

◆ GetByName() [2/2]

IMPORT_C void RHostResolver::GetByName ( const TDesC &  aName,
TNameEntry &  aResult,
TRequestStatus &  aStatus 
)

Resolves a machine name to a TSockAddress asynchronously.

The server will fill in the supplied TNameEntry.

Parameters
aNameThe name to resolve. The format of the name and any wild-cards supported, along with any separators in hierarchical name systems, are protocol specific
aResultOn return, the result of the name resolution. If more than one result is allowed by the protocol, the client can call Next() to find any further results.
aStatusIndicates asynchronous operation and, on completion, contains an error code: see the system-wide error codes.

(generated from Symbian Developer Library)

◆ GetHostName() [1/2]

IMPORT_C TInt RHostResolver::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 SetHostName() must have been made.

Parameters
aNameReturns the result of the query. The buffer passed in should have a minimum length of 256 characters, otherwise a panic may occur: you can use a parameter of the THostName type.
capability
Dependent on the type of connection so deferred to PRT

(generated from Symbian Developer Library)

◆ GetHostName() [2/2]

IMPORT_C void RHostResolver::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 SetHostName() must have been made.

Parameters
aNameReturns the result of the query. The buffer passed in should have a minimum length of 256 characters, otherwise a panic may occur: you can use a parameter of the THostName type.
aStatusIndicates asynchronous operation and on completion contains an error code: see the system-wide error codes.
capability
Dependent on the type of connection so deferred to PRT

(generated from Symbian Developer Library)

◆ Next() [1/2]

IMPORT_C TInt RHostResolver::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, GetByName() and GetByAddress() may find more than one answer, for example if aliases are allowed.

Parameters
aResultReturns the next result of the name resolution.

(generated from Symbian Developer Library)

◆ Next() [2/2]

IMPORT_C void RHostResolver::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, GetByName() and GetByAddress() may find more than one answer, for example if aliases are allowed.

Parameters
aResultReturns the next result of the name resolution.
aStatusIndicates asynchronous operation and on completion contains an error code: see the system-wide error codes.

(generated from Symbian Developer Library)

◆ Open() [1/2]

IMPORT_C TInt RHostResolver::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.

Parameters
aSocketServerThe socket server session
anAddrFamilyA constant identifying the protocol family
aProtocolA constant that identifies the protocol that provides the name resolution service

(generated from Symbian Developer Library)

◆ Open() [2/2]

IMPORT_C TInt RHostResolver::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.

Parameters
anAddrFamilyA constant identifying the protocol family.
aProtocolA constant that identifies the protocol that provides the name resolution service.
aConnectionExisting RConnection whose interface this Host Resolver will be associated with.

(generated from Symbian Developer Library)

◆ Query() [1/2]

IMPORT_C TInt RHostResolver::Query ( const TDesC8 &  aQuery,
TDes8 &  aResult 
)

Protocol - independent query.

Synchronous version.

Parameters
aQuerycontains query data. The concrete type of the data depends on protocol. e.g. for tcpip it will imply DNS query.
aResultDescriptor that will receive data. The concrete meaning of this data depends on protocol.
capability
Dependent on the type of connection so deferred to PRT

(generated from Symbian Developer Library)

◆ Query() [2/2]

IMPORT_C void RHostResolver::Query ( const TDesC8 &  aQuery,
TDes8 &  aResult,
TRequestStatus &  aStatus 
)

Protocol - independent query.

Asynchronous version.

Parameters
aQuerycontains query data. The concrete type of the data depends on protocol. e.g. for tcpip it will imply DNS query.
aResultDescriptor that will receive data. The concrete meaning of this data depends on protocol.
aStatusindicates asynchronous operation, on completion contains a system-wide error code
capability
Dependent on the type of connection so deferred to PRT

(generated from Symbian Developer Library)

◆ QueryGetNext() [1/2]

IMPORT_C TInt RHostResolver::QueryGetNext ( TDes8 &  aResult)

Get the next query result.

For some queries there can be more than one results. Synchronous version.

Parameters
aResultDescriptor that will receive data. The concrete meaning of this data depends on protocol.

(generated from Symbian Developer Library)

◆ QueryGetNext() [2/2]

IMPORT_C void RHostResolver::QueryGetNext ( TDes8 &  aResult,
TRequestStatus &  aStatus 
)

Get the next query result.

For some queries there can be more than one results. Asynchronous version.

Parameters
aResultDescriptor that will receive data. The concrete meaning of this data depends on protocol.
aStatusindicates asynchronous operation, on completion contains a system-wide error code. In particular KErrNotFound means that there is no more information from resolver.

(generated from Symbian Developer Library)

◆ SetHostName()

IMPORT_C TInt RHostResolver::SetHostName ( const TDesC &  aName)
Parameters
aNameThe local host name.
capability
NetworkControl Service restricting and stored at protocol level

(generated from Symbian Developer Library)

◆ SetOpt()

IMPORT_C TInt RHostResolver::SetOpt ( TUint  anOptionName,
TUint  anOptionLevel,
const TDesC8 &  anOption = TPtrC8(NULL, 0) 
)

The documentation for this class was generated from the following files: