RServiceResolver Class Reference

#include <es_sock.h>

Link against: esock.lib

class RServiceResolver : public RSubSessionBase

Inherits from

Detailed Description

Provides an interface to resolver service names and ports.

Member Function Documentation

Cancel ( )

IMPORT_C voidCancel()

Cancels any pending request.

Close ( )

IMPORT_C voidClose()

Closes a service resolver service

If a service has been opened using Open(), then it should be closed using Close(). This will ensure all associated resources are released.

GetByName ( const TDesC &, TPortNum &, TRequestStatus & )

IMPORT_C voidGetByName(const TDesC &aName,
TPortNum &aPort,
TRequestStatus &aStatus
)

Gets a service by name asynchronously.

Parameters
aNameName of the service to get.
aPortOn completion, the port associated with the service.
aStatusOn completion, KErrNone if successful otherwise another of the system-wide error codes.

GetByName ( const TDesC &, TPortNum & )

IMPORT_C TIntGetByName(const TDesC &aName,
TPortNum &aPort
)

Get a service by name.

Parameters
aNameName of the service to get.
aPortOn return, the port associated with the service.
Return Value
KErrNone if successful otherwise another of the system-wide error codes.

GetByNumber ( const TUint, TDes &, TRequestStatus & )

IMPORT_C voidGetByNumber(const TUintaPort,
TDes &aName,
TRequestStatus &aStatus
)

Gets the name of the service asynchronously.

Parameters
aPortPort of the service.
aNameOn completion, the name of the service.
aStatusOn completion, KErrNone if successful otherwise another of the system-wide error codes.

GetByNumber ( const TUint, TDes & )

IMPORT_C TIntGetByNumber(const TUintaPort,
TDes &aName
)

Gets the name of the service

Parameters
aPortPort of the service.
aNameOn return, the name of the service.
Return Value
KErrNone if successful otherwise another of the system-wide error codes.

Open ( RSocketServ &, TUint, TUint, TUint )

IMPORT_C TIntOpen(RSocketServ &aSocketServer,
TUintanAddrFamily,
TUintsockType,
TUintaProtocol
)

set up the sub session - unlike name resolvers and net databases, services can be socket type specific. Opens a service resolver service.

Unlike name resolvers (RHostResolver) and net databases (RNetDatabase), services can be socket type specific.

Parameters
aSocketServerThe socket server session.
anAddrFamilyA constant identifying the protocol family.
sockTypeA constant that identifies the socket type.
aProtocolA constant that identifies the protocol that provides the service.
Return Value
KErrNone if successful otherwise another of the system-wide error codes.

RegisterService ( const TDesC &, const TUint &, TRequestStatus & )

IMPORT_C voidRegisterService(const TDesC &aName,
const TUint &aPort,
TRequestStatus &aStatus
)

Registers a new service asynchronously.

Parameters
aNameName of the service.
aPortPort of the service.
aStatusOn completion, KErrNone if successful otherwise another of the system-wide error codes.
Capability
NetworkControlTo protect against dangerous new services being added, which may steal legimate services resources

RegisterService ( const TDesC &, const TUint & )

IMPORT_C TIntRegisterService(const TDesC &aName,
const TUint &aPort
)

Registers a new service.

Parameters
aNameName of the service.
aPortPort of the service.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.
Capability
NetworkControlTo protect against dangerous new services being added, which may steal legimate services resources

RemoveService ( const TDesC &, const TUint &, TRequestStatus & )

IMPORT_C voidRemoveService(const TDesC &aName,
const TUint &aPort,
TRequestStatus &aStatus
)

Removes a service asynchronously.

Parameters
aNameName of the service to remove.
aPortPort of the service to remove.
aStatusOn completion, KErrNone if successful otherwise another of the system-wide error codes.
Capability
NetworkControlEnsure that only privileged apps can remove information from the service resolver

RemoveService ( const TDesC &, const TUint & )

IMPORT_C TIntRemoveService(const TDesC &aName,
const TUint &aPort
)

Removes a service.

Parameters
aNameName of the service.
aPortPort of the service.
Return Value
KErrNone if successful otherwise another of the system-wide error codes.
Capability
NetworkControlEnsure that only privileged apps can remove information from the service resolver