#include <wapmessage.h>
Link against:
wapmsgcli.lib
Class CWapBoundCLPushService
class CWapBoundCLPushService : public CBase;
Description
Listens for WAP Push messages from any sender.
The class is an ECom plug-in interface. Clients use CWapBoundCLPushService::NewL()
to request an implementation of the interface, and then call the interface's virtual functions to access the implementation's
services.
The use of the plug-in architecture allows different implementations to use different underlying WAP stacks.
Functions can return system wide error codes, and also API-specific errors as defined in wapmsgerr.h
.
Derivation
CBase
-
Base class for all classes to be instantiated on the heap.
CWapBoundCLPushService
- Listens for WAP Push messages from any sender.
Members
Defined in CWapBoundCLPushService
:
Inherited from CBase
:
Construction and destruction
IMPORT_C static CWapBoundCLPushService* NewL();
Description
Allocates and creates a new CWapBoundCLPushService object.
Return value
Leave codes
IMPORT_C static CWapBoundCLPushService* NewL(const TUid &aImplementation);
Description
Allocates and creates a new CWapBoundCLPushService object.
Parameters
const TUid &aImplementation |
|
|
Return value
Leave codes
~CWapBoundCLPushService()
IMPORT_C virtual ~CWapBoundCLPushService();
Description
Destructor
protected: IMPORT_C CWapBoundCLPushService();
Description
protected: IMPORT_C void ConstructL();
Description
Connect(Wap::TBearer,Wap::TPort,TBool,TInetAddr)
virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure, TInetAddr aInetAddr)=0;
Description
Connects to the WAP stack, opening an endpoint that can be used to listen for Push messages from any sender.
This overload of CWapBoundCLPushService::Connect(Wap::TBearer,Wap::TPort,TBool,TInetAddr)
allows an IP address associated with a network interface to be specified. In multihomed systems, this can be used to specify
the network interface to which the endpoint should be bound.
All CWapBoundCLPushService implementations must automatically close this endpoint upon destruction.
Parameters
Wap::TBearer aBearer |
The bearer to listen on. Use EAll to specify all bearers.
|
Wap::TPort aPort |
The port to listen on. If set to 0, a local port will be chosen for the client's first SendTo()
|
TBool aSecure |
Security flag to indicate whether WTLS should be used or not
|
TInetAddr aInetAddr |
The address of the adapter to use
|
|
Return value
TInt
|
KErrNone on successful completion, or one of the system error codes on failure.
|
|
Connect(Wap::TBearer,Wap::TPort,TBool)
virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure)=0;
Description
Connects to the WAP stack, opening an endpoint that can be used to listen for Push messages from any sender.
All CWapBoundCLPushService implementations must automatically close this endpoint upon destruction.
Parameters
Wap::TBearer aBearer |
The bearer to listen on. Use EAll to specify all bearers.
|
Wap::TPort aPort |
The port to listen on. If set to 0, a local port will be chosen for the client's first SendTo()
|
TBool aSecure |
Security flag to indicate whether WTLS should be used or not
|
|
Return value
TInt
|
KErrNone on successful completion, or one of the system error codes on failure.
|
|
AwaitPush(TDes8 &,TDes8 &,TPckgBuf< TUint8 > &,TRequestStatus &)
virtual TInt AwaitPush(TDes8 &aPushHeaders, TDes8 &aPushBody, TPckgBuf< TUint8 > &aPushIdPckg, TRequestStatus &aReqStatus)=0;
Description
Requests an asynchronous notification upon arrival of the next push message on the listening connection.
The request completes upon receipt of the message, filling the buffers with as much received data as possible. A return code
indicates whether further data remains. The call must be re-issued for subsequent messages or to receive remaining data from
a previous push message.
Parameters
TDes8 &aPushHeaders |
A client-allocated buffer that, on completion, is filled with the push message's header data
|
TDes8 &aPushBody |
A client-allocated buffer that, on completion, is filled with the push message's body data
|
TPckgBuf < TUint8 > &aPushIdPckg |
On completion, an integer ID that uniquely specifies the push message
|
TRequestStatus &aReqStatus |
Asynchonrous status word, used by the service provider to notify the client when a push message has arrived. EMoreData is
returned if more pushed data is available.
|
|
Return value
TInt
|
KErrNone on successful completion, or one of the system error codes on failure.
|
|
virtual void CancelAwaitPush()=0;
Description
Cancels a previous push message request.
If a push message arrives, the client will not be notified.
GetLocalPort(Wap::TPort &)
virtual TInt GetLocalPort(Wap::TPort &aPort)=0;
Description
Gets the local port of this endpoint.
This is useful if the port was chosen automatically.
Parameters
Return value
TInt
|
KErrNone on successful completion, or one of the system error codes on failure.
|
|
GetLocalAddress(HBufC8 *&)
virtual TInt GetLocalAddress(HBufC8 *&aLocalHost)=0;
Description
Gets the local address of this endpoint.
Parameters
HBufC8 *&aLocalHost |
On return, the address of the local host. Clients must pass in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 buffer to hold the address, and passes ownership of the buffer to the client.
|
|
Return value
TInt
|
KErrNone on successful completion, or one of the system error codes on failure.
|
|
GetBearer(Wap::TBearer &)
virtual TInt GetBearer(Wap::TBearer &aBearer)=0;
Description
Gets the bearer on which a received datagram arrived.
This is useful when EAll was specified as the bearer in CWapBoundCLPushService::Connect(Wap::TBearer,Wap::TPort,TBool,TInetAddr)
.
Parameters
Return value
TInt
|
KErrNone on successful completion, or one of the system error codes on failure.
|
|
GetServerAddress(HBufC8 *&)
virtual TInt GetServerAddress(HBufC8 *&aRemoteHost)=0;
Description
Gets the address of the remote server.
This function cannot be called when there is an outstanding CWapBoundCLPushService::AwaitPush(TDes8 &,TDes8 &,TPckgBuf< TUint8 > &,TRequestStatus &)
.
Parameters
HBufC8 *&aRemoteHost |
On return, the address of the remote host. Clients must pass in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 buffer to hold the address, and passes ownership of the buffer to the client.
|
|
Return value
TInt
|
KErrNone on successful completion, KErrNotSupported if not implemented, or one of the system error codes on failure.
|
|