Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: wapcli.h
Link against: wapstkcli.lib

Class RWDPConn

RWDPConn

Support

Supported from 6.0

Description

WDP (Wireless Datagram Protocol) provides a general datagram transport service above the various data capable bearer services.

For error codes, see TReturnCodes, and RWAPConn::TReturnCodes.

Derivation

RSubSessionBaseClient-side handle to a sub-session
RWAPConnOperations available on connections in all stack layers
RWDPConnWDP (Wireless Datagram Protocol) provides a general datagram transport service above the various data capable bearer services

Defined in RWDPConn:
CancelRecv(), EInvalidParameter, Open(), Recv(), Send(), SendTo(), TReturnCodes

Inherited from RSubSessionBase:
CloseSubSession(), CreateSubSession(), SendReceive(), SubSessionHandle(), operator=()

Inherited from RWAPConn:
CancelAll(), Close(), EBadConnection, EBearerError, EBufferTooSmall, ECannotOpenPort, EDelete, EGet, EHead, EMoreData, EOptions, EPortAlreadyBound, EPost, EPut, ETooManyConnections, ETrace, GetBearer(), GetLocalPort(), GetRemoteAddress(), TMethod, TPort


Member functions


CancelRecv()

void CancelRecv();

Description

Cancels an asynchronous RecvFrom() request.


Open()

TInt Open(RWAPServ& aServer,TPort aLocalPort);

Description

Initialises a bound connection. This is used to wait for a remote connect (listening). Services that listen for incoming data to a bound connection receive data from all available bearers.

Parameters

RWAPServ& aServer

Handle to the session with the EPOC WAP server

TPort aLocalPort

Local port. If 0, the port is allocated automatically.

Return value

TInt

Error code


Open()

TInt Open(RWAPServ& aServer,
          const TDesC8& aRemoteHost,
          TPort aRemotePort,
          TPort aLocalPort,
          TBearer aBearer,
          TBool aSecureConn);

Description

Initialises a fully specified connection.

Parameters

RWAPServ& aServer

Handle to the session with the EPOC WAP server

const TDesC8& aRemoteHost

Remote address. The format is dependent on the bearer.

TPort aRemotePort

Remote port

TPort aLocalPort

Local port. If 0, the port is allocated automatically.

TBearer aBearer

Bearer to use

TBool aSecureConn

Always EFalse

Return value

TInt

Error code


Recv()

void Recv(TDes8& aRemoteAddress,
          TPckg<TUint16>& aRemotePort,
          TDes8& aBuffer,
          TRequestStatus& aStatus);

Description

Receives a buffer from a bound connection.

If the connection is fully specified when opened, it will receive only from that host, otherwise datagrams can be received from any host.

The function completes as soon as a datagram is received. If aBuffer is too small, then the function completes with KErrOverflow and throws away the extra data.

Parameters

TDes8& aRemoteAddress

On completion, remote address

TPckg<TPort>& aRemotePort

On completion, remote address

TDes8& aBuffer

On completion, data buffer from remote

TRequestStatus& aStatus

Asynchronous request status


Send()

TInt Send(const TDesC8& aBuffer);

Description

Sends a buffer to a destination specified in the fully defined connection.

Parameters

const TDesC8& aBuffer

Data to send

Return value

TInt

Error code


SendTo()

TInt SendTo(const TDesC8& aRemoteAddress,
            TPort aRemotePort,
            const TDesC8& aBuffer);

Description

Sends a buffer to the destination specified in the arguments.

Note: this way of sending may not be used with secure (WTLS) connections.

Parameters

const TDesC8& aRemoteAddress

Remote address

TPort aRemotePort

Remote port

const TDesC8& aBuffer

Data to send

Return value

TInt

Error code

[Top]


Enum TReturnCodes

TReturnCodes

Description

Error codes.

EInvalidParameter

Given parameter is invalid