Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: IMSK.H
Link against: imut.lib

Class CImTextServerSession

class CImTextServerSession : public CMsgActive;

Description

Creates/opens socket and sends and receives data.

Derivation

Members

Defined in CImTextServerSession:
Disconnect(), Disconnect(), DoCancel(), DoComplete(), DoRunL(), EImClientMode, EImServerMode, GetConnectionStage(), GetCurrentTextLine(), GetIAPBearer(), GetIAPValue(), GetRConnectionName(), LocalName(), LogError(), LogText(), NewL(), NewL(), NewL(), NewLC(), PerformLogging(), QueueConnect(), QueueConnect(), QueueConnect(), QueueConnect(), QueueConnect(), QueueConnect(), QueueConnectL(), QueueReceiveNextTextLine(), Receive(), Receive(), ReceiveBinaryData(), SSLQueueConnectL(), Send(), Send(), Send(), Send(), SendQueueReceive(), SendQueueReceive(), SendQueueReceiveWithTimeout(), SendReceive(), SendWithTimeout(), SetPrimaryTextServerSession(), SetSSLTLSResponseL(), SetSecurity(), TImOperationMode


Construction and destruction


NewL()

static IMPORT_C CImTextServerSession *NewL();

Pre-Condition

None

Description

cat Construction Intended Usage : Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack.

Post-Condition

A fully constructed and initialised CImTextServerSession object.

Return value

CImTextServerSession *

A pointer to the newly created CImTextServerSession object.

Leave codes

KErrNoMemory.


NewL()

static IMPORT_C CImTextServerSession *NewL(TInt aSendIdleTime, TInt aReceiveIdleTime);

Pre-Condition

None

Description

cat Construction Intended Usage : Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack.

Post-Condition

A fully constructed and initialised CImTextServerSession object.

Parameters

TInt aSendIdleTime

is the time for which the idle timer runs (for a send)

TInt aReceiveIdleTime

is the time for which the idle timer runs (for a recieve)

Return value

CImTextServerSession *

A pointer to the newly created CImTextServerSession object.

Leave codes

KErrNoMemory.


NewLC()

static IMPORT_C CImTextServerSession *NewLC(TImOperationMode aMode, RSocketServ &aServerServ);

Description

Parameters

TImOperationMode aMode

RSocketServ &aServerServ

Return value

CImTextServerSession *


NewL()

static IMPORT_C CImTextServerSession *NewL(RSocketServ &aServerServ);

Description

Parameters

RSocketServ &aServerServ

Return value

CImTextServerSession *

[Top]


Member functions


QueueConnectL()

IMPORT_C void QueueConnectL(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, const CImIAPPreferences &aIAPPreferences, TBool aEnableTimeout=ETrue);

Pre-Condition

None

Description

Intended Usage : Queue a connect assuming the socket is successfully opened. Error Condition : KErrNoMemory

Post-Condition

connection is ready to send and receive data.

Parameters

TRequestStatus &aStatus

Asynchronous completion status

const TDesC &anAddressDesc

is the IP address

TInt aPortNum

is the port number eg. 143, 25, 110.

const CImIAPPreferences &aIAPPreferences

is the IAP connection preference to be used

TBool aEnableTimeout

Not used


SSLQueueConnectL()

IMPORT_C void SSLQueueConnectL(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, const CImIAPPreferences &aIAPPreferences, TBool aEnableTimeout=ETrue);

Pre-Condition

None

Description

Intended Usage : Queue a wrapped SSL connect on an socket assuming the socket is successfully opened. Error Condition : KErrNoMemory, EImskSocketOpen

Post-Condition

connection is ready to send and receive data.

Parameters

TRequestStatus &aStatus

Asynchronous completion status

const TDesC &anAddressDesc

is the IP address

TInt aPortNum

is the port number eg. 993, 465, 995.

const CImIAPPreferences &aIAPPreferences

is the IAP connection preference to be used

TBool aEnableTimeout

Not used


Disconnect()

IMPORT_C void Disconnect();

Pre-Condition

None

Description

Intended Usage : To disconnect and close socket connection. Error Condition : None

Post-Condition

connection is closed.


Disconnect()

IMPORT_C void Disconnect(TRequestStatus &aStatus);

Description

Parameters

TRequestStatus &aStatus


LocalName()

IMPORT_C const TDesC &LocalName();

Description

Return value

const TDesC &


SetSSLTLSResponseL()

IMPORT_C void SetSSLTLSResponseL(const TDesC8 &aDesc);

Pre-Condition

aDesc cannot be zero length

Description

This method should be called before Send/SendQueueReceive() TLS command is sent. Intended Usage : To use for secure connection. Error Condition : KErrNoMemory

Post-Condition

iTLSResponse is filled with aDesc contents

Parameters

const TDesC8 &aDesc

is the positive response the MTM expects from the connected server for TLS command. e.g. OK, +OK, 220 etc..

Leave codes

EImskNoTLSResponseString


Send()

IMPORT_C void Send(TRequestStatus &aStatus, const TDesC8 &aDesc);

Description

Intended Usage : To send data. Error Condition : None

Post-Condition

None

Parameters

TRequestStatus &aStatus

Asynchronous completion status

const TDesC8 &aDesc

is the aData to be sent


SendWithTimeout()

IMPORT_C void SendWithTimeout(TRequestStatus &aStatus, TInt aIdleTime, const TDesC8 &aDesc);

Description

Parameters

TRequestStatus &aStatus

TInt aIdleTime

const TDesC8 &aDesc


SendQueueReceiveWithTimeout()

IMPORT_C void SendQueueReceiveWithTimeout(TRequestStatus &aStatus, TInt aIdleTime, const TDesC8 &aDesc);

Description

Parameters

TRequestStatus &aStatus

TInt aIdleTime

const TDesC8 &aDesc


Send()

IMPORT_C void Send(TRequestStatus &aStatus, TRefByValue< const TDesC8 > aFmt,...);

Description

Parameters

TRequestStatus &aStatus

TRefByValue< const TDesC8 > aFmt

...


SendQueueReceive()

IMPORT_C void SendQueueReceive(TRequestStatus &aStatus, const TDesC8 &aDesc);

Description

Intended Usage : To send data and queue a receive. Error Condition : None

Post-Condition

Sends the data and queues a receive. GetCurrentTextLine should be called after this method to read received data

Parameters

TRequestStatus &aStatus

Asynchronous completion status

const TDesC8 &aDesc

is the aData to be sent


SendQueueReceive()

IMPORT_C void SendQueueReceive(TRequestStatus &aStatus, TRefByValue< const TDesC8 > aFmt,...);

Description

Parameters

TRequestStatus &aStatus

TRefByValue< const TDesC8 > aFmt

...


GetCurrentTextLine()

IMPORT_C TImLineType GetCurrentTextLine(TDes8 &aDesc);

Description

Returns first full line of data received from socket to user Intended Usage : To return received data. Error Condition : None

Post-Condition

returns the received buffer in the form of aDesc

Parameters

TDes8 &aDesc

will be filled with received buffer

Return value

TImLineType

EReceiveBufferEmpty when received data is empty EBufferTooSmall when aDesc length is smaller than received data ECRLFTerminated when received data is complete (full line) EReceiveBufferFull when received data length is more than aDesc length GetCurrentTextLine should be called after Send methods


QueueReceiveNextTextLine()

IMPORT_C void QueueReceiveNextTextLine(TRequestStatus &aStatus);

Description

User queues a new request from the socket (unless there's a full line of data in buffer then signal user and there's no need to make a receive request) Intended Usage : User queues a new request from the socket. Error Condition : None

Parameters

TRequestStatus &aStatus

for asynchronous request


ReceiveBinaryData()

IMPORT_C void ReceiveBinaryData(TRequestStatus &aStatus, TDes8 &aDes, TInt aLen);

Description

Intended Usage : Users queue a request for received data Error Condition : None

Post-Condition

aDes will be filled with received data of aLen. ReceiveBinaryData should be called after Send.

Parameters

TRequestStatus &aStatus

Asynchronous completion status

TDes8 &aDes

is the aData to be received

TInt aLen

is the length of the data the user wants to read


LogText()

IMPORT_C void LogText(const TDesC8 &aString);

Description

Parameters

const TDesC8 &aString


LogError()

IMPORT_C void LogError(const TDesC8 &aString, const TInt aError);

Description

Parameters

const TDesC8 &aString

const TInt aError


GetIAPValue()

IMPORT_C TInt GetIAPValue(TUint32 &aIAP);

Description

Intended Usage : Returns the IAP we are connecting/connected with in aIAP or returns an error code

Post-Condition

aIAP will be filled with current IAP connected.

Parameters

TUint32 &aIAP

will be the current IAP

Return value

TInt

will return genconn errors if any


GetRConnectionName()

IMPORT_C TInt GetRConnectionName(TName &aName);

Description

Intended Usage : Returns the name of the RConnection.

Post-Condition

aName will be filled with current name of the RConnection.

Parameters

TName &aName

Buffer in which the name is returned.

Return value

TInt

KErrNone if successful, or another of the system-wide error codes.


GetIAPBearer()

IMPORT_C TInt GetIAPBearer(TUint32 &aBearer);

Description

Returns the bearer type we are connected to with in aBearer or returns an error code

Parameters

TUint32 &aBearer

Return value

TInt


GetConnectionStage()

IMPORT_C TInt GetConnectionStage();

Description

Intended Usage : Gets the stage of the connection process obtained from RConnection

Return value

TInt

The current connection stage from RConnection or a system-wide error code.


SetPrimaryTextServerSession()

IMPORT_C void SetPrimaryTextServerSession(CImTextServerSession *aPrimaryTextServerSession);

Description

Parameters

CImTextServerSession *aPrimaryTextServerSession


QueueConnect()

IMPORT_C void QueueConnect(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, TBool aEnableTimeout=ETrue);

Description

Parameters

TRequestStatus &aStatus

const TDesC &anAddressDesc

TInt aPortNum

TBool aEnableTimeout


QueueConnect()

IMPORT_C void QueueConnect(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, const CImIAPPreferences &aIAPPreferences, TInt aType, TBool aEnableTimeout=ETrue);

Description

Parameters

TRequestStatus &aStatus

const TDesC &anAddressDesc

TInt aPortNum

const CImIAPPreferences &aIAPPreferences

TInt aType

TBool aEnableTimeout


QueueConnect()

IMPORT_C void QueueConnect(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, TCallBack aDisconnectFunction, const TUint32 aIntraddress, TInt aType, TBool aEnableTimeout=ETrue);

Description

Parameters

TRequestStatus &aStatus

const TDesC &anAddressDesc

TInt aPortNum

TCallBack aDisconnectFunction

const TUint32 aIntraddress

TInt aType

TBool aEnableTimeout


QueueConnect()

IMPORT_C void QueueConnect(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, const TUint32 aIAPaddress, TInt aType, TBool aEnableTimeout=ETrue);

Description

Parameters

TRequestStatus &aStatus

const TDesC &anAddressDesc

TInt aPortNum

const TUint32 aIAPaddress

TInt aType

TBool aEnableTimeout


QueueConnect()

IMPORT_C void QueueConnect(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, TCallBack aDisconnectFunction, TBool aEnableTimeout=ETrue);

Description

Parameters

TRequestStatus &aStatus

const TDesC &anAddressDesc

TInt aPortNum

TCallBack aDisconnectFunction

TBool aEnableTimeout


QueueConnect()

IMPORT_C void QueueConnect(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, TCallBack aDisconnectFunction, const CImIAPPreferences &aIAPPreferences, TInt aType, TBool aEnableTimeout=ETrue);

Description

Parameters

TRequestStatus &aStatus

const TDesC &anAddressDesc

TInt aPortNum

TCallBack aDisconnectFunction

const CImIAPPreferences &aIAPPreferences

TInt aType

TBool aEnableTimeout


Send()

IMPORT_C TInt Send(const TDesC8 &aDesc);

Description

Parameters

const TDesC8 &aDesc

Return value

TInt


Send()

IMPORT_C TInt Send(TRefByValue< const TDesC8 > aFmt,...);

Description

Parameters

TRefByValue< const TDesC8 > aFmt

...

Return value

TInt


SendReceive()

IMPORT_C TInt SendReceive(const TDesC8 &aDesc);

Description

Parameters

const TDesC8 &aDesc

Return value

TInt


Receive()

IMPORT_C TInt Receive(TDes8 &rDes);

Description

Parameters

TDes8 &rDes

Return value

TInt


Receive()

IMPORT_C void Receive(TRequestStatus &aStatus, TDes8 &rDes);

Description

Parameters

TRequestStatus &aStatus

TDes8 &rDes


SetSecurity()

IMPORT_C TInt SetSecurity(TBool aSecurityOn, TBool aUnattendedMode=0);

Description

Parameters

TBool aSecurityOn

TBool aUnattendedMode

Return value

TInt


PerformLogging()

IMPORT_C void PerformLogging(TBool aLogging);

Description

Parameters

TBool aLogging


DoRunL()

private: virtual void DoRunL();

Description


DoComplete()

private: virtual void DoComplete(TInt &aStatusValue);

Description

Parameters

TInt &aStatusValue


DoCancel()

private: virtual void DoCancel();

Description

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel().

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel().

[Top]


Member enumerations


Enum TImOperationMode

TImOperationMode

Description

EImServerMode

EImClientMode