»
Developer Library »
API Reference »
C++ API reference »
Sockets Client »
RServiceResolver
class RServiceResolver : public RSubSessionBase;
Description
Provides an interface to resolver service names and ports.
Derivation
RServiceResolver | Provides an interface to resolver service names and ports |
RSubSessionBase | Client-side handle to a sub-session |
|
Defined in RServiceResolver:
Cancel(), Close(), GetByName(), GetByName(), GetByNumber(), GetByNumber(), Open(), RegisterService(), RegisterService(), RemoveService(), RemoveService()
Inherited from RSubSessionBase:
CloseSubSession(),
CreateSubSession(),
Send(),
SendReceive(),
SubSessionHandle(),
operator=()
Member functions
TInt Open(RSocketServ& aSocketServer, TUint anAddrFamily, TUint sockType, TUint aProtocol);
Description
Set up the sub session. Unlike name resolvers (RHostResolver) and net databases (RNetDatabase), services can be socket type specific.
Parameters
RSocketServ& aSocketServer |
The socket server session. |
TUint anAddrFamily |
A constant identifying the protocol family. |
TUint sockType |
A constant that identifies the socket type. |
TUint aProtocol |
A constant that identifies the protocol that provides the service. |
|
Return value
TInt
|
KErrNone if successful otherwise another of the
system-wide error codes.
|
|
void GetByName(const TDesC& aName, TPortNum& aPort, TRequestStatus& aStatus);
Description
Get a service by name asynchronously.
Parameters
const TDesC& aName |
Name of the service to get. |
TPortNum& aPort |
On completion, the port associated with the service. |
TRequestStatus& aStatus |
On completion, KErrNone if successful otherwise another of the
system-wide error codes. |
|
TInt GetByName(const TDesC& aName, TPortNum& aPort);
Description
Get a service by name.
Parameters
const TDesC& aName |
Name of the service to get. |
TPortNum& aPort |
On return, the port associated with the service. |
|
Return value
TInt
|
KErrNone if successful otherwise another of the
system-wide error codes.
|
|
void GetByNumber(const TUint aPort, TDes& aName, TRequestStatus& aStatus);
Description
Gets the name of the service asynchronously.
Parameters
const TUint aPort |
Port of the service. |
TDes& aName |
On completion, the name of the service. |
TRequestStatus& aStatus |
On completion, KErrNone if successful otherwise another of the
system-wide error codes. |
|
TInt GetByNumber(const TUint aPort, TDes& aName);
Description
Gets the name of the service
Parameters
const TUint aPort |
Port of the service. |
TDes& aName |
On return, the name of the service. |
|
Return value
TInt
|
KErrNone if successful otherwise another of the
system-wide error codes.
|
|
void RegisterService(const TDesC& aName, const TUint& aPort, TRequestStatus& aStatus);
Description
Register a new service asynchronously.
Parameters
const TDesC& aName |
Name of the service. |
const TUint& aPort |
Port of the service. |
TRequestStatus& aStatus |
On completion, KErrNone if successful otherwise another of the
system-wide error codes. |
|
TInt RegisterService(const TDesC& aName, const TUint& aPort);
Description
Register a new service.
Parameters
const TDesC& aName |
Name of the service. |
const TUint& aPort |
Port of the service. |
|
Return value
TInt
|
KErrNone if successful otherwise another of the
system-wide error codes.
|
|
void RemoveService(const TDesC& aName, const TUint& aPort, TRequestStatus& aStatus);
Description
Remove a service asynchronously.
Parameters
const TDesC& aName |
Name of the service to remove. |
const TUint& aPort |
Port of the service to remove. |
TRequestStatus& aStatus |
On completion, KErrNone if successful otherwise another of the
system-wide error codes. |
|
TInt RemoveService(const TDesC& aName, const TUint& aPort);
Description
Remove a service.
Parameters
const TDesC& aName |
Name of the service. |
const TUint& aPort |
Port of the service. |
|
Return value
TInt
|
KErrNone if successful otherwise another of the
system-wide error codes.
|
|
void Close();
Description
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.
void Cancel();
Description
Cancel any pending request.