Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <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:


Construction and destruction


NewL()

IMPORT_C static 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(TInt,TInt)

IMPORT_C static 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(TImOperationMode,RSocketServ &)

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

Description

Parameters

CImTextServerSession::TImOperationMode aMode

RSocketServ &aServerServ

Return value

CImTextServerSession *


NewL(RSocketServ &)

IMPORT_C static CImTextServerSession* NewL(RSocketServ &aServerServ);

Description

Parameters

RSocketServ &aServerServ

Return value

CImTextServerSession *

[Top]


Member functions


QueueConnectL(TRequestStatus &,const TDesC &,TInt,const CImIAPPreferences &,TBool)

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 TDesC16 &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


QueueConnectL(TRequestStatus &,const TDesC &,TInt,const CImIAPPreferences &,const TDesC8 &)

IMPORT_C void QueueConnectL(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, const CImIAPPreferences &aIAPPreferences, const TDesC8 &aSSLDomainName);

Pre-Condition

None

Description

Queue a connect on a socket assuming the socket is successfully opened.

Post-Condition

Connection is ready to send and receive data

Parameters

TRequestStatus &aStatus

Asynchronous completion status

const TDesC16 &anAddressDesc

TInt aPortNum

Port number eg. 993, 465, 995.

const CImIAPPreferences &aIAPPreferences

IAP connection preferences to be used

const TDesC8 &aSSLDomainName

SSL domain name to use for the connection


SSLQueueConnectL(TRequestStatus &,const TDesC &,TInt,const CImIAPPreferences &,TBool)

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 TDesC16 &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


SSLQueueConnectL(TRequestStatus &,const TDesC &,TInt,const CImIAPPreferences &,const TDesC8 &)

IMPORT_C void SSLQueueConnectL(TRequestStatus &aStatus, const TDesC &anAddressDesc, TInt aPortNum, const CImIAPPreferences &aIAPPreferences, const TDesC8 &aSSLDomainName);

Pre-Condition

None

Description

Queue a wrapped SSL connect on a socket assuming the socket is successfully opened.

Post-Condition

Connection is ready to send and receive data

Parameters

TRequestStatus &aStatus

Asynchronous completion status

const TDesC16 &anAddressDesc

TInt aPortNum

Port number eg. 993, 465, 995.

const CImIAPPreferences &aIAPPreferences

IAP connection preferences to be used

const TDesC8 &aSSLDomainName

SSL domain name to use for the connection


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(TRequestStatus &)

IMPORT_C void Disconnect(TRequestStatus &aStatus);

Description

Parameters

TRequestStatus &aStatus


LocalName()

IMPORT_C const TDesC& LocalName();

Description

Return value

const TDesC16 &


SetSSLTLSResponseL(const TDesC8 &)

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(TRequestStatus &,const TDesC8 &)

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(TRequestStatus &,TInt,const TDesC8 &)

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

Description

Parameters

TRequestStatus &aStatus

TInt aIdleTime

const TDesC8 &aDesc


SendQueueReceiveWithTimeout(TRequestStatus &,TInt,const TDesC8 &)

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

Description

Parameters

TRequestStatus &aStatus

TInt aIdleTime

const TDesC8 &aDesc


Send(TRequestStatus &,TRefByValue< const TDesC8 >,...)

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

Description

Parameters

TRequestStatus &aStatus

TRefByValue< const TDesC8 > aFmt

...


SendQueueReceive(TRequestStatus &,const TDesC8 &)

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(TRequestStatus &,TRefByValue< const TDesC8 >,...)

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

Description

Parameters

TRequestStatus &aStatus

TRefByValue< const TDesC8 > aFmt

...


GetCurrentTextLine(TDes8 &)

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(TRequestStatus &)

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(TRequestStatus &,TDes8 &,TInt)

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(const TDesC8 &)

IMPORT_C void LogText(const TDesC8 &aString);

Description

Parameters

const TDesC8 &aString


LogError(const TDesC8 &,const TInt)

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

Description

Parameters

const TDesC8 &aString

const TInt aError


GetIAPValue(TUint32 &)

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(TName &)

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

TBuf &aName

Buffer in which the name is returned.

Return value

TInt

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


GetIAPBearer(TUint32 &)

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(CImTextServerSession *)

IMPORT_C void SetPrimaryTextServerSession(CImTextServerSession *aPrimaryTextServerSession);

Description

Parameters

CImTextServerSession *aPrimaryTextServerSession


QueueConnect(TRequestStatus &,const TDesC &,TInt,TBool)

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

Description

Parameters

TRequestStatus &aStatus

const TDesC16 &anAddressDesc

TInt aPortNum

TBool aEnableTimeout


QueueConnect(TRequestStatus &,const TDesC &,TInt,const CImIAPPreferences &,TInt,TBool)

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

Description

Parameters

TRequestStatus &aStatus

const TDesC16 &anAddressDesc

TInt aPortNum

const CImIAPPreferences &aIAPPreferences

TInt aType

TBool aEnableTimeout


QueueConnect(TRequestStatus &,const TDesC &,TInt,TCallBack,const TUint32,TInt,TBool)

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 TDesC16 &anAddressDesc

TInt aPortNum

TCallBack aDisconnectFunction

const TUint32 aIntraddress

TInt aType

TBool aEnableTimeout


QueueConnect(TRequestStatus &,const TDesC &,TInt,const TUint32,TInt,TBool)

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

Description

Parameters

TRequestStatus &aStatus

const TDesC16 &anAddressDesc

TInt aPortNum

const TUint32 aIAPaddress

TInt aType

TBool aEnableTimeout


QueueConnect(TRequestStatus &,const TDesC &,TInt,TCallBack,TBool)

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

Description

Parameters

TRequestStatus &aStatus

const TDesC16 &anAddressDesc

TInt aPortNum

TCallBack aDisconnectFunction

TBool aEnableTimeout


QueueConnect(TRequestStatus &,const TDesC &,TInt,TCallBack,const CImIAPPreferences &,TInt,TBool)

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 TDesC16 &anAddressDesc

TInt aPortNum

TCallBack aDisconnectFunction

const CImIAPPreferences &aIAPPreferences

TInt aType

TBool aEnableTimeout


Send(const TDesC8 &)

IMPORT_C TInt Send(const TDesC8 &aDesc);

Description

Parameters

const TDesC8 &aDesc

Return value

TInt


Send(TRefByValue< const TDesC8 >,...)

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

Description

Parameters

TRefByValue< const TDesC8 > aFmt

...

Return value

TInt


SendReceive(const TDesC8 &)

IMPORT_C TInt SendReceive(const TDesC8 &aDesc);

Description

Parameters

const TDesC8 &aDesc

Return value

TInt


Receive(TDes8 &)

IMPORT_C TInt Receive(TDes8 &rDes);

Description

Parameters

TDes8 &rDes

Return value

TInt


Receive(TRequestStatus &,TDes8 &)

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

Description

Parameters

TRequestStatus &aStatus

TDes8 &rDes


SetSecurity(TBool,TBool)

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

Description

Parameters

TBool aSecurityOn

TBool aUnattendedMode

Return value

TInt


PerformLogging(TBool)

IMPORT_C void PerformLogging(TBool aLogging);

Description

Parameters

TBool aLogging


DoRunL()

private: virtual void DoRunL();

Description


DoComplete(TInt &)

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 CActive::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.

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

See also:

[Top]


Member enumerations


Enum TImOperationMode

TImOperationMode

Description

EImServerMode

EImClientMode