RServiceResolver Class Reference

#include <es_sock.h>

Link against: esock.lib

class RServiceResolver : public RSubSessionBase

Inherits from

  • RServiceResolver

    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.

    ParameterDescription
    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.

    ParameterDescription
    aNameName of the service to get.
    aPortOn return, the port associated with the service.

    Returns: 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.

    ParameterDescription
    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

    ParameterDescription
    aPortPort of the service.
    aNameOn return, the name of the service.

    Returns: 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.

    ParameterDescription
    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.

    Returns: 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.

    capability
    NetworkControl To protect against dangerous new services being added, which may steal legimate services resources
    ParameterDescription
    aNameName of the service.
    aPortPort of the service.
    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
    ParameterDescription
    aNameName of the service.
    aPortPort of the service.

    Returns: KErrNone if successful, otherwise another of the system-wide error codes.

    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
    ParameterDescription
    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.

    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
    ParameterDescription
    aNameName of the service.
    aPortPort of the service.

    Returns: KErrNone if successful otherwise another of the system-wide error codes.