RServiceResolver Class Reference

class RServiceResolver : public RSubSessionBase

Provides an interface to resolver service names and ports.

Inherits from

Member Functions 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

const TDesC & aNameName of the service to get.
TPortNum & aPortOn completion, the port associated with the service.
TRequestStatus & 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

const TDesC & aNameName of the service to get.
TPortNum & aPortOn return, the port associated with the service.

GetByNumber(const TUint, TDes &, TRequestStatus &)

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

Gets the name of the service asynchronously.

Parameters

const TUint aPortPort of the service.
TDes & aNameOn completion, the name of the service.
TRequestStatus & 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

const TUint aPortPort of the service.
TDes & aNameOn return, the name of the service.

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

RSocketServ & aSocketServerThe socket server session.
TUint anAddrFamilyA constant identifying the protocol family.
TUint sockTypeA constant that identifies the socket type.
TUint aProtocolA constant that identifies the protocol that provides the service.

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

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

Registers a new service asynchronously.

capability
NetworkControl To protect against dangerous new services being added, which may steal legimate services resources

Parameters

const TDesC & aNameName of the service.
const TUint & aPortPort of the service.
TRequestStatus & aStatusOn completion, KErrNone if successful otherwise another of the system-wide error codes.

RegisterService(const TDesC &, const TUint &)

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

Registers a new service.

capability
NetworkControl To protect against dangerous new services being added, which may steal legimate services resources

Parameters

const TDesC & aNameName of the service.
const TUint & aPortPort of the service.

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

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

Removes a service asynchronously.

capability
NetworkControl Ensure that only privileged apps can remove information from the service resolver

Parameters

const TDesC & aNameName of the service to remove.
const TUint & aPortPort of the service to remove.
TRequestStatus & aStatusOn completion, KErrNone if successful otherwise another of the system-wide error codes.

RemoveService(const TDesC &, const TUint &)

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

Removes a service.

capability
NetworkControl Ensure that only privileged apps can remove information from the service resolver

Parameters

const TDesC & aNameName of the service.
const TUint & aPortPort of the service.