CImTextServerSession Class Reference

#include <mw/imsk.h>

Link against: imut.lib

class CImTextServerSession : public CMsgActive

Inherits from

Public Member Enumerations
enumTImOperationMode { EImServerMode, EImClientMode }
Public Member Functions
~CImTextServerSession()
IMPORT_C voidDisconnect()
IMPORT_C voidDisconnect(TRequestStatus &)
CImConnect *GetCImConnect()
IMPORT_C TIntGetConnectionStage()
IMPORT_C TImLineTypeGetCurrentTextLine(TDes8 &)
IMPORT_C TIntGetIAPBearer(TUint32 &)
IMPORT_C TIntGetIAPValue(TUint32 &)
IMPORT_C TIntGetLastSocketActivityTimeout(TUint32 &)
IMPORT_C TIntGetRConnectionName(TName &)
RSocketServ &GetSocketServ()
IMPORT_C const TDesC &LocalName()
IMPORT_C voidLogError(const TDesC8 &, const TInt)
IMPORT_C voidLogText(const TDesC8 &)
IMPORT_C CImTextServerSession *NewL()
IMPORT_C CImTextServerSession *NewL(RSocketServ &, CImConnect &)
IMPORT_C CImTextServerSession *NewL(TInt, TInt)
IMPORT_C CImTextServerSession *NewL(TInt, TInt, RSocketServ &, CImConnect &)
IMPORT_C CImTextServerSession *NewL(RSocketServ &)
IMPORT_C CImTextServerSession *NewLC(TImOperationMode, RSocketServ &)
IMPORT_C voidPerformLogging(TBool)
IMPORT_C voidQueueConnect(TRequestStatus &, const TDesC &, TInt, TBool)
IMPORT_C voidQueueConnect(TRequestStatus &, const TDesC &, TInt, const CImIAPPreferences &, TInt, TBool)
IMPORT_C voidQueueConnect(TRequestStatus &, const TDesC &, TInt, TCallBack, const TUint32, TInt, TBool)
IMPORT_C voidQueueConnect(TRequestStatus &, const TDesC &, TInt, const TUint32, TInt, TBool)
IMPORT_C voidQueueConnect(TRequestStatus &, const TDesC &, TInt, TCallBack, TBool)
IMPORT_C voidQueueConnect(TRequestStatus &, const TDesC &, TInt, TCallBack, const CImIAPPreferences &, TInt, TBool)
IMPORT_C voidQueueConnectL(TRequestStatus &, const TDesC &, TInt, const CImIAPPreferences &, TBool)
IMPORT_C voidQueueConnectL(TRequestStatus &, const TDesC &, TInt, const CImIAPPreferences &, const TDesC8 &)
IMPORT_C voidQueueReceiveNextTextLine(TRequestStatus &)
IMPORT_C TIntReceive(TDes8 &)
IMPORT_C voidReceive(TRequestStatus &, TDes8 &)
IMPORT_C voidReceiveBinaryData(TRequestStatus &, TDes8 &, TInt)
IMPORT_C voidSSLQueueConnectL(TRequestStatus &, const TDesC &, TInt, const CImIAPPreferences &, TBool)
IMPORT_C voidSSLQueueConnectL(TRequestStatus &, const TDesC &, TInt, const CImIAPPreferences &, const TDesC8 &)
IMPORT_C voidSend(TRequestStatus &, const TDesC8 &)
IMPORT_C voidSend(TRequestStatus &, TRefByValue< const TDesC8 >, ...)
IMPORT_C TIntSend(const TDesC8 &)
IMPORT_C TIntSend(TRefByValue< const TDesC8 >, ...)
IMPORT_C voidSendQueueReceive(TRequestStatus &, const TDesC8 &)
IMPORT_C voidSendQueueReceive(TRequestStatus &, TRefByValue< const TDesC8 >, ...)
IMPORT_C voidSendQueueReceiveWithTimeout(TRequestStatus &, TInt, const TDesC8 &)
IMPORT_C TIntSendReceive(const TDesC8 &)
IMPORT_C voidSendWithTimeout(TRequestStatus &, TInt, const TDesC8 &)
IMPORT_C voidSetPrimaryTextServerSession(CImTextServerSession *)
IMPORT_C voidSetSSLTLSResponseL(const TDesC8 &)
IMPORT_C TIntSetSecurity(TBool, TBool)
voidSocketIdle()
voidTimeOut()
Inherited Attributes
CActive::iStatus
Inherited Enumerations
CActive:TPriority
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CMsgActive::CMsgActive(TInt)
CMsgActive::Complete(TInt)
CMsgActive::Queue(TRequestStatus &)
CMsgActive::~CMsgActive()

Detailed Description

Creates/opens socket and sends and receives data.

Member Enumeration Documentation

Enum TImOperationMode

EnumeratorValueDescription
EImServerMode
EImClientMode

Constructor & Destructor Documentation

~CImTextServerSession ( )

~CImTextServerSession()

cat Destruction

Intended Usage : Destructor.
Since
6.0

Member Function Documentation

Disconnect ( )

IMPORT_C voidDisconnect()
Intended Usage : To disconnect and close socket connection. Error Condition : None
Since
6.0
Pre-condition
None
Post-condition
connection is closed.

Disconnect ( TRequestStatus & )

IMPORT_C voidDisconnect(TRequestStatus &aStatus)

GetCImConnect ( )

CImConnect *GetCImConnect()
Intended Usage : Returns the CImConnect object
Since
9.2
Post-condition
Going to be use on the secondary session
Return Value
CImConnect

GetConnectionStage ( )

IMPORT_C TIntGetConnectionStage()
Intended Usage : Gets the stage of the connection process obtained from RConnection
Since
7.0s
Return Value
The current connection stage from RConnection or a system-wide error code.

GetCurrentTextLine ( TDes8 & )

IMPORT_C TImLineTypeGetCurrentTextLine(TDes8 &aDesc)

Returns first full line of data received from socket to user

Intended Usage : To return received data. Error Condition : None
Since
6.0
Post-condition
returns the received buffer in the form of aDesc
Parameters
aDescwill be filled with received buffer
Return Value
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

GetIAPBearer ( TUint32 & )

IMPORT_C TIntGetIAPBearer(TUint32 &aBearer)

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

GetIAPValue ( TUint32 & )

IMPORT_C TIntGetIAPValue(TUint32 &aIAP)
Intended Usage : Returns the IAP we are connecting/connected with in aIAP or returns an error code
Since
6.0
Post-condition
aIAP will be filled with current IAP connected.
Parameters
aIAPwill be the current IAP
Return Value
will return genconn errors if any

GetLastSocketActivityTimeout ( TUint32 & )

IMPORT_C TIntGetLastSocketActivityTimeout(TUint32 &aTimeout)
Intended Usage : Returns the last socket activity timeout value
Since
9.1
Post-condition
aTimeout will be filled with the timeout value
Parameters
aTimeoutis a return argument containing the timeout if it was found
Return Value
Returns KErrNone, KErrNotFound or KErrBadHandle

GetRConnectionName ( TName & )

IMPORT_C TIntGetRConnectionName(TName &aName)
Intended Usage : Returns the name of the RConnection.
Since
9.1
Post-condition
aName will be filled with current name of the RConnection.
Parameters
aNameBuffer in which the name is returned.
Return Value
KErrNone if successful, or another of the system-wide error codes.

GetSocketServ ( )

RSocketServ &GetSocketServ()
Intended Usage : Returns the Socket Server
Since
8.0
Return Value
Socket Server

LocalName ( )

IMPORT_C const TDesC &LocalName()

LogError ( const TDesC8 &, const TInt )

IMPORT_C voidLogError(const TDesC8 &aString,
const TIntaError
)

LogText ( const TDesC8 & )

IMPORT_C voidLogText(const TDesC8 &aString)

NewL ( )

IMPORT_C CImTextServerSession *NewL()[static]

cat Construction

Intended Usage : Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack.
Since
6.0
Pre-condition
None
Post-condition
A fully constructed and initialised CImTextServerSession object.
Return Value
A pointer to the newly created CImTextServerSession object.
Leave Codes
KErrNoMemory.

NewL ( RSocketServ &, CImConnect & )

IMPORT_C CImTextServerSession *NewL(RSocketServ &aSocketServ,
CImConnect &aConnect
)[static]

NewL ( TInt, TInt )

IMPORT_C CImTextServerSession *NewL(TIntaSendIdleTime,
TIntaReceiveIdleTime
)[static]

cat Construction

Intended Usage : Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack.
Since
7.0s
Pre-condition
None
Post-condition
A fully constructed and initialised CImTextServerSession object.
Factory constructor that allows setting of send and receive idle times.

An idle time of zero implies that no timer should be set.

Parameters
aSendIdleTimeThe idle time in minutes allowed for sending. A value of zero indicates that no timer should be set.
aReceiveIdleTimeThe idle time in minutes allowed for receiving. A value of zero indicates that no timer should be set.
Return Value
A pointer to the newly created CImTextServerSession object. A pointer to the newly created CImTextServerSession object.
Leave Codes
KErrNoMemory.

NewL ( TInt, TInt, RSocketServ &, CImConnect & )

IMPORT_C CImTextServerSession *NewL(TIntaSendIdleTime,
TIntaReceiveIdleTime,
RSocketServ &aSocketServ,
CImConnect &aConnect
)[static]

NewL ( RSocketServ & )

IMPORT_C CImTextServerSession *NewL(RSocketServ &aServerServ)[static]

NewLC ( TImOperationMode, RSocketServ & )

IMPORT_C CImTextServerSession *NewLC(TImOperationModeaMode,
RSocketServ &aServerServ
)[static]

PerformLogging ( TBool )

IMPORT_C voidPerformLogging(TBoolaLogging)

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

IMPORT_C voidQueueConnect(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
TBoolaEnableTimeout = ETrue
)

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

IMPORT_C voidQueueConnect(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
const CImIAPPreferences &aIAPPreferences,
TIntaType,
TBoolaEnableTimeout = ETrue
)

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

IMPORT_C voidQueueConnect(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
TCallBackaDisconnectFunction,
const TUint32aIntraddress,
TIntaType,
TBoolaEnableTimeout = ETrue
)

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

IMPORT_C voidQueueConnect(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
const TUint32aIAPaddress,
TIntaType,
TBoolaEnableTimeout = ETrue
)

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

IMPORT_C voidQueueConnect(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
TCallBackaDisconnectFunction,
TBoolaEnableTimeout = ETrue
)

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

IMPORT_C voidQueueConnect(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
TCallBackaDisconnectFunction,
const CImIAPPreferences &aIAPPreferences,
TIntaType,
TBoolaEnableTimeout = ETrue
)

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

IMPORT_C voidQueueConnectL(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
const CImIAPPreferences &aIAPPreferences,
TBoolaEnableTimeout = ETrue
)
Intended Usage : Queue a connect assuming the socket is successfully opened. Error Condition : KErrNoMemory
Since
6.0
Pre-condition
None
Post-condition
connection is ready to send and receive data.
Parameters
aStatusAsynchronous completion status
anAddressDescis the IP address
aPortNumis the port number eg. 143, 25, 110.
aIAPPreferencesis the IAP connection preference to be used
aEnableTimeoutNot used

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

IMPORT_C voidQueueConnectL(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
const CImIAPPreferences &aIAPPreferences,
const TDesC8 &aSSLDomainName
)

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

Pre-condition
None
Post-condition
Connection is ready to send and receive data
Since
9.5
Parameters
aStatusAsynchronous completion status
aPortNumPort number eg. 993, 465, 995.
aIAPPreferencesIAP connection preferences to be used
aSSLDomainNameSSL domain name to use for the connection

QueueReceiveNextTextLine ( TRequestStatus & )

IMPORT_C voidQueueReceiveNextTextLine(TRequestStatus &aStatus)

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
Since
6.0
Parameters
aStatusfor asynchronous request

Receive ( TDes8 & )

IMPORT_C TIntReceive(TDes8 &rDes)

Receive ( TRequestStatus &, TDes8 & )

IMPORT_C voidReceive(TRequestStatus &aStatus,
TDes8 &rDes
)

ReceiveBinaryData ( TRequestStatus &, TDes8 &, TInt )

IMPORT_C voidReceiveBinaryData(TRequestStatus &aStatus,
TDes8 &aDes,
TIntaLen
)
Intended Usage : Users queue a request for received data Error Condition : None
Since
6.0
Post-condition
aDes will be filled with received data of aLen. ReceiveBinaryData should be called after Send.
Parameters
aStatusAsynchronous completion status
aDesis the aData to be received
aLenis the length of the data the user wants to read

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

IMPORT_C voidSSLQueueConnectL(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
const CImIAPPreferences &aIAPPreferences,
TBoolaEnableTimeout = ETrue
)
Intended Usage : Queue a wrapped SSL connect on an socket assuming the socket is successfully opened. Error Condition : KErrNoMemory, EImskSocketOpen
Since
7.0s
Pre-condition
None
Post-condition
connection is ready to send and receive data.
Parameters
aStatusAsynchronous completion status
anAddressDescis the IP address
aPortNumis the port number eg. 993, 465, 995.
aIAPPreferencesis the IAP connection preference to be used
aEnableTimeoutNot used

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

IMPORT_C voidSSLQueueConnectL(TRequestStatus &aStatus,
const TDesC &anAddressDesc,
TIntaPortNum,
const CImIAPPreferences &aIAPPreferences,
const TDesC8 &aSSLDomainName
)

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

Pre-condition
None
Post-condition
Connection is ready to send and receive data
Since
9.5
Parameters
aStatusAsynchronous completion status
aPortNumPort number eg. 993, 465, 995.
aIAPPreferencesIAP connection preferences to be used
aSSLDomainNameSSL domain name to use for the connection

Send ( TRequestStatus &, const TDesC8 & )

IMPORT_C voidSend(TRequestStatus &aStatus,
const TDesC8 &aDesc
)
Intended Usage : To send data. Error Condition : None
Since
6.0
Post-condition
None
Parameters
aStatusAsynchronous completion status
aDescis the aData to be sent

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

IMPORT_C voidSend(TRequestStatus &aStatus,
TRefByValue< const TDesC8 >aFmt,
...
)

Send ( const TDesC8 & )

IMPORT_C TIntSend(const TDesC8 &aDesc)

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

IMPORT_C TIntSend(TRefByValue< const TDesC8 >aFmt,
...
)

SendQueueReceive ( TRequestStatus &, const TDesC8 & )

IMPORT_C voidSendQueueReceive(TRequestStatus &aStatus,
const TDesC8 &aDesc
)
Intended Usage : To send data and queue a receive. Error Condition : None
Since
6.0
Post-condition
Sends the data and queues a receive. GetCurrentTextLine should be called after this method to read received data
Parameters
aStatusAsynchronous completion status
aDescis the aData to be sent

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

IMPORT_C voidSendQueueReceive(TRequestStatus &aStatus,
TRefByValue< const TDesC8 >aFmt,
...
)

SendQueueReceiveWithTimeout ( TRequestStatus &, TInt, const TDesC8 & )

IMPORT_C voidSendQueueReceiveWithTimeout(TRequestStatus &aStatus,
TIntaIdleTime,
const TDesC8 &aDesc
)

SendReceive ( const TDesC8 & )

IMPORT_C TIntSendReceive(const TDesC8 &aDesc)

SendWithTimeout ( TRequestStatus &, TInt, const TDesC8 & )

IMPORT_C voidSendWithTimeout(TRequestStatus &aStatus,
TIntaIdleTime,
const TDesC8 &aDesc
)

SetPrimaryTextServerSession ( CImTextServerSession * )

IMPORT_C voidSetPrimaryTextServerSession(CImTextServerSession *aPrimaryTextServerSession)
Intended Usage : Users set only on the secondary session
Since
9.2
Pre-condition
None
Post-condition
Going to be use on the secondary session
Parameters
aPrimaryTextServerSessionis PrimarySession's TextServerSession

SetSSLTLSResponseL ( const TDesC8 & )

IMPORT_C voidSetSSLTLSResponseL(const TDesC8 &aDesc)

This method should be called before Send/SendQueueReceive() TLS command is sent.

Intended Usage : To use for secure connection. Error Condition : KErrNoMemory
Since
6.2
Pre-condition
aDesc cannot be zero length
Post-condition
iTLSResponse is filled with aDesc contents
Parameters
aDescis the positive response the MTM expects from the connected server for TLS command. e.g. OK, +OK, 220 etc..
Leave Codes
EImskNoTLSResponseString

SetSecurity ( TBool, TBool )

IMPORT_C TIntSetSecurity(TBoolaSecurityOn,
TBoolaUnattendedMode = FALSE
)

SocketIdle ( )

voidSocketIdle()
Intended Usage : disconnects the socket and notifies the observer when the socket has been idle for some time
Since
7.0s

TimeOut ( )

voidTimeOut()