Zeroconf::RZeroconfSession

Zeroconf::RZeroconfSession Class Reference

The main interface to the Zeroconf server. More...

#include <zeroconfclient.h>


Public Member Functions

void OpenL (TUint32 &aIapId)
 Opens a new session with the zeroconf server.
TVersion ServerVersionL ()
 Fetches the version of the zeroconf server.
void RecieveMessagesL (TBool aRecMessages)
 Notify the server that the client does/does not wish to recieve asynchronous notification messages.
void MessageNotify (TRequestStatus &aStatus)
 Requests notification of a zeroconf message being available in the client's queue.
void MessageNotifyCancel ()
 Cancels an outstanding call to MessageNotify.
void NextMessageL (TZeroconfMessage &aMessage)
 Fetches the next zeroconf message from the client's queue.
void ServiceTypesL (RPointerArray< CServiceType > &aServiceTypes)
 Fetches a list of service types currently known on the network.
CServiceResolveServiceL (const TDesC &aServiceName, const TDesC &aServiceType, Zeroconf::TServiceProtocol aProtocol)
 Synchronously resolves a network service.
void ResolveService (const TDesC &aServiceName, const TDesC &aServiceType, Zeroconf::TServiceProtocol aProtocol, TRequestStatus &aStatus)
 Asynchronously resolves a network service.
CServiceServiceL (const TDesC &aServiceName, const TDesC &aServiceType, Zeroconf::TServiceProtocol aProtocol)
 Fetches a service record previously resolved using the asynchronous overload of ResolveServiceL.
TInt Resolve (const TDesC &aHost, TInetAddr &aAddr)
 Synchronously resolves a specified host name to an address.
void Resolve (const TDesC &aHost, TInetAddr &aAddr, TRequestStatus &aStatus)
 Asynchronously resolves a specified host name to an address.
void CancelResolve ()
 Cancels an outstanding asynchronous Resolve or ResolveService operation.
void HintServiceL (const TDesC &aServiceType, Zeroconf::TServiceProtocol aProtocol)
 Hint to the zeroconf framework that the client is especially intested in services of the given type.
void HintServiceTypesL ()
 Hint ot the zeroconf framework that the client is interested in knowing about all service types on the network.

Detailed Description

The main interface to the Zeroconf server.

The RZeroconfSession class is the main interface to the zeroconf server. It enables users to resolve link-local DNS names, find instances of services available on the local network, and enumerate the known service types that the network is offering.

In addition, the RZeroconfSession class offers asynchronous notification of events on the local network, such as the advertisement of new services, or their removal.


Member Function Documentation

void Zeroconf::RZeroconfSession::OpenL ( TUint32 &  aIapId  ) 

Opens a new session with the zeroconf server.

Opens a new session with the zeroconf server. Must be called before any other function may be used.

Parameters:
aIapId The Internet Access Point you require the zeroconf server to listen on. Often derived from RConnection.
Precondition:
Zeroconf server clients must have the NetworkServices capability.

TVersion Zeroconf::RZeroconfSession::ServerVersionL (  ) 

Fetches the version of the zeroconf server.

Fetch the version of the zeroconf server. Included for future binary compatability purposes.

Returns:
The version of the zeroconf server.
Precondition:
Zeroconf server clients must have the NetworkServices capability.

void Zeroconf::RZeroconfSession::RecieveMessagesL ( TBool  aRecMessages  ) 

Notify the server that the client does/does not wish to recieve asynchronous notification messages.

Notify the server that the client does/does not wish to recieve asynchronous notification messages. Message reception defaults to off, if your client wishes to recieve messages you must first call this method.

Parameters:
aRecMessages ETrue if you wish to start recieving messages, EFalse to turn off message reception.
Precondition:
Zeroconf server clients must have the NetworkServices capability.

void Zeroconf::RZeroconfSession::MessageNotify ( TRequestStatus &  aStatus  ) 

Requests notification of a zeroconf message being available in the client's queue.

Requests a notification of a zeroconf message being available in the client's queue. The TRequestStatus object passed to this call will be completed when a message becomes available. The client should then fetch the message using the NextMessageL method.

Parameters:
aStatus A TRequestStatus object to be signalled when a zeroconf message is available.
Precondition:
Zeroconf server clients must have the NetworkServices capability.

void Zeroconf::RZeroconfSession::MessageNotifyCancel (  ) 

Cancels an outstanding call to MessageNotify.

Cancels an outstanding call to MessageNotify. The original call will be completed with KErrCancel.

Precondition:
Zeroconf server clients must have the NetworkServices capability.

void Zeroconf::RZeroconfSession::NextMessageL ( TZeroconfMessage aMessage  ) 

Fetches the next zeroconf message from the client's queue.

Fetches the next zeroconf message from the client's queue. Clients should first have made certain a message is available by using the MessageNotify method.

Precondition:
Zeroconf server clients must have the NetworkServices capability.
Parameters:
aMessage On return, the TZeroconfMessage passed will be populated with the incoming message.

void Zeroconf::RZeroconfSession::ServiceTypesL ( RPointerArray< CServiceType > &  aServiceTypes  ) 

Fetches a list of service types currently known on the network.

Fetches a list of service types currently known on the local network. The client is resposible for the deletion of all the objects in the returned array, together with the array memory itself.

Precondition:
Zeroconf server clients must have the NetworkServices capability.
Parameters:
aServiceTypes On return, the array will be populated with all currently known service types.

CService* Zeroconf::RZeroconfSession::ResolveServiceL ( const TDesC &  aServiceName,
const TDesC &  aServiceType,
Zeroconf::TServiceProtocol  aProtocol 
)

Synchronously resolves a network service.

Synchronously resolves a network service. The caller is responsible for deleting the returned CService object when they have no further use for it.

Precondition:
Zeroconf server clients must have the NetworkServices capability.
Parameters:
aServiceName A unicode descriptor containing the name of the service you wish to resolve.
aServiceType A unicode descriptor containing the type of the service you wish to resolve, including leading underscore (e.g. '_http'.)
aProtocol The protocol the service runs over, one of TCP or UDP.
Returns:
A CService object comprising a complete description of the service parameters.

void Zeroconf::RZeroconfSession::ResolveService ( const TDesC &  aServiceName,
const TDesC &  aServiceType,
Zeroconf::TServiceProtocol  aProtocol,
TRequestStatus &  aStatus 
)

Asynchronously resolves a network service.

Asynchronously resolves a network service. When this call completes, the client should call ServiceL to fetch the service record.

Precondition:
Zeroconf server clients must have the NetworkServices capability.
Parameters:
aServiceName A unicode descriptor containing the name of the service you wish to resolve.
aServiceType A unicode descriptor containing the type of the service you wish to resolve, including leading underscore (e.g. '_http'.)
aProtocol The protocol the service runs over, one of TCP or UDP.
aStatus A TRequeustStatus object to be signalled when the service resolution is complete.

CService* Zeroconf::RZeroconfSession::ServiceL ( const TDesC &  aServiceName,
const TDesC &  aServiceType,
Zeroconf::TServiceProtocol  aProtocol 
)

Fetches a service record previously resolved using the asynchronous overload of ResolveServiceL.

Fetches a service record previously resolved using the asynchronous ResolveService method. The caller is responsible for deleting the CService object when they have no further use for it.

Precondition:
Zeroconf server clients must have the NetworkServices capability.
Parameters:
aServiceName A unicode descriptor containing the name of the service you wish to resolve.
aServiceType A unicode descriptor containing the type of the service you wish to resolve, including leading underscore (e.g. '_http'.)
aProtocol The protocol the service runs over, one of TCP or UDP.
Returns:
A CService object comprising a complete description of the service parameters.

TInt Zeroconf::RZeroconfSession::Resolve ( const TDesC &  aHost,
TInetAddr &  aAddr 
)

Synchronously resolves a specified host name to an address.

Synchronously resolves a specifed host name to an address. The supplied host name need not include the '.local' suffix.

Precondition:
Zeroconf server clients must have the NetworkServices capability.
Parameters:
aHost A unicode descriptor containing the host name to resolve.
aAddr On return, contains the IP address of the resolved host.
Returns:
KErrNone on sucess, KErrNotFound if the host name could not be resolved. Otherwise another system error code.

void Zeroconf::RZeroconfSession::Resolve ( const TDesC &  aHost,
TInetAddr &  aAddr,
TRequestStatus &  aStatus 
)

Asynchronously resolves a specified host name to an address.

Asynchronously resolves a specifed host name to an address. The supplied host name need not include the '.local' suffix.

Precondition:
Zeroconf server clients must have the NetworkServices capability.
Parameters:
aHost A unicode descriptor containing the host name to resolve.
aAddr On completion, contains the IP address of the resolved host.
aStatus A TRequestStatus object to be signalled when the request is complete.

void Zeroconf::RZeroconfSession::CancelResolve (  ) 

Cancels an outstanding asynchronous Resolve or ResolveService operation.

Cancels an outstanding asynchronous Resolve or ResolveService operation.

Precondition:
Zeroconf server clients must have the NetworkServices capability.

void Zeroconf::RZeroconfSession::HintServiceL ( const TDesC &  aServiceType,
Zeroconf::TServiceProtocol  aProtocol 
)

Hint to the zeroconf framework that the client is especially intested in services of the given type.

Hint to the zeroconf framework that the client is especially intested in services of the given type. This should be done at startup by clients that wish to know about instances of a particular service available on the network to ensure getting prompt notifications. This should be done after the client has enabled the reception of messages with the RecieveMessageL method.

Precondition:
Zeroconf server clients must have the NetworkServices capability.
Parameters:
aServiceType A unicode descriptor containing the service type the client is interested in, including leading underscore (e.g. '_http'.)
aProtocol The protocol over which the service runs, one of TCP or UDP.

void Zeroconf::RZeroconfSession::HintServiceTypesL (  ) 

Hint ot the zeroconf framework that the client is interested in knowing about all service types on the network.

Hint to the zeroconf framework that the client is interested in knowing about all the service types running on the local network.

Precondition:
Zeroconf server clients must have the NetworkServices capability.