1.1 --- a/epoc32/include/imsk.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,605 +0,0 @@
1.4 -// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -// This file contains the API definition for the class CImTextServerSession.
1.18 -// This class creates sockets and is responsible for transmitting data between client and the server
1.19 -//
1.20 -//
1.21 -
1.22 -
1.23 -
1.24 -/**
1.25 - @file
1.26 -*/
1.27 -
1.28 -
1.29 -#ifndef __IMSK_H__
1.30 -#define __IMSK_H__
1.31 -
1.32 -#include <e32base.h>
1.33 -#include <es_sock.h>
1.34 -#include <in_sock.h>
1.35 -#include <f32file.h>
1.36 -#include <mentact.h>
1.37 -#include <miutlog.h>
1.38 -#include <miut_err.h>
1.39 -#include <miuthdr.h>
1.40 -
1.41 -#ifdef _DEBUG
1.42 -#define __IMSK_SIMULATION
1.43 -#endif
1.44 -
1.45 -// Enable Scripting in Debug Builds only
1.46 -#ifdef _DEBUG
1.47 -#define __IMSK_SCRIPTING
1.48 -#endif
1.49 -
1.50 -const TInt EActivePriorityHigh = 1;
1.51 -const TInt KCarriageLineFeedLength=2;
1.52 -/** Max numeric IP address len = "0:0:0:0:0:0:194.217.242.23" = 45 chars */
1.53 -const TInt KImskIPAddressLen=45; // Max numeric IP address len = "255.255.255.255" = 15 chars
1.54 -
1.55 -/** Maximum buffer size of the received data
1.56 -@internalTechnology
1.57 -@released
1.58 -*/
1.59 -typedef TBuf8<KImMailMaxBufferSize> TImMailBuffer;
1.60 -
1.61 -/** received buffer data line type
1.62 -@internalTechnology
1.63 -@released
1.64 -*/
1.65 -enum TImLineType
1.66 - {
1.67 - ECRLFTerminated,
1.68 - EBufferTooSmall,
1.69 - EReceiveBufferFull,
1.70 - EReceiveBufferEmpty
1.71 - };
1.72 -
1.73 -
1.74 -class CImLog;
1.75 -class CImTextServerScript;
1.76 -class CImIAPPreferences;
1.77 -class CImConnect;
1.78 -class CSecureSocket;
1.79 -class CImSocketIdleTimer;
1.80 -
1.81 -/**
1.82 -Creates/opens socket and sends and receives data.
1.83 -
1.84 -@publishedAll
1.85 -@released
1.86 -*/
1.87 -class CImTextServerSession : public CMsgActive
1.88 - {
1.89 -public:
1.90 - enum TImOperationMode{
1.91 - EImServerMode,
1.92 - EImClientMode
1.93 - };
1.94 -
1.95 -/**
1.96 - //cat Construction
1.97 - @fn NewL()
1.98 - Intended Usage : Static factory constructor. Uses two phase construction and
1.99 - leaves nothing on the CleanupStack.
1.100 - @since 6.0
1.101 - @leave KErrNoMemory.
1.102 - @return A pointer to the newly created CImTextServerSession object.
1.103 - @pre None
1.104 - @post A fully constructed and initialised CImTextServerSession object.
1.105 -
1.106 - */
1.107 - IMPORT_C static CImTextServerSession *NewL();
1.108 -
1.109 - /**
1.110 - @internalTechnology
1.111 - @released
1.112 - */
1.113 - IMPORT_C static CImTextServerSession* NewL(RSocketServ& aSocketServ, CImConnect& aConnect);
1.114 -
1.115 -/**
1.116 - //cat Construction
1.117 - @fn NewL(TInt aSendIdleTime, TInt aReceiveIdleTime)
1.118 - Intended Usage : Static factory constructor. Uses two phase construction and
1.119 - leaves nothing on the CleanupStack.
1.120 - @since 7.0s
1.121 - @param aSendIdleTime is the time for which the idle timer runs (for a send)
1.122 - @param aReceiveIdleTime is the time for which the idle timer runs (for a recieve)
1.123 - @leave KErrNoMemory.
1.124 - @return A pointer to the newly created CImTextServerSession object.
1.125 - @pre None
1.126 - @post A fully constructed and initialised CImTextServerSession object.
1.127 - */
1.128 - IMPORT_C static CImTextServerSession* NewL(TInt aSendIdleTime, TInt aReceiveIdleTime);
1.129 -
1.130 - /**
1.131 - @internalTechnology
1.132 - @released
1.133 - */
1.134 - IMPORT_C static CImTextServerSession* NewL(TInt aSendIdleTime, TInt aReceiveIdleTime, RSocketServ& aSocketServ, CImConnect& aConnect);
1.135 -
1.136 -/**
1.137 - //cat Destruction
1.138 - @fn ~CImTextServerSession()
1.139 - Intended Usage : Destructor.
1.140 - @since 6.0
1.141 - */
1.142 - ~CImTextServerSession();
1.143 -
1.144 -/**
1.145 - @fn QueueConnectL(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, const CImIAPPreferences& aIAPPreferences, TBool aEnableTimeout = ETrue)
1.146 - Intended Usage : Queue a connect assuming the socket is successfully opened.
1.147 - Error Condition : KErrNoMemory
1.148 - @since 6.0
1.149 - @param aStatus Asynchronous completion status
1.150 - @param anAddressDesc is the IP address
1.151 - @param aIAPPreferences is the IAP connection preference to be used
1.152 - @param aPortNum is the port number eg. 143, 25, 110.
1.153 - @param aEnableTimeout Not used
1.154 - @pre None
1.155 - @post connection is ready to send and receive data.
1.156 - */
1.157 - IMPORT_C void QueueConnectL(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, const CImIAPPreferences& aIAPPreferences, TBool aEnableTimeout = ETrue);
1.158 -
1.159 - IMPORT_C void QueueConnectL(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, const CImIAPPreferences& aIAPPreferences, const TDesC8& aSSLDomainName);
1.160 -
1.161 -/**
1.162 - @fn SSLQueueConnectL(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, const CImIAPPreferences& aIAPPreferences, TBool aEnableTimeout = ETrue)
1.163 - Intended Usage : Queue a wrapped SSL connect on an socket assuming the socket is successfully opened.
1.164 - Error Condition : KErrNoMemory, EImskSocketOpen
1.165 - @since 7.0s
1.166 - @param aStatus Asynchronous completion status
1.167 - @param anAddressDesc is the IP address
1.168 - @param aIAPPreferences is the IAP connection preference to be used
1.169 - @param aPortNum is the port number eg. 993, 465, 995.
1.170 - @param aEnableTimeout Not used
1.171 - @pre None
1.172 - @post connection is ready to send and receive data.
1.173 - */
1.174 - IMPORT_C void SSLQueueConnectL(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, const CImIAPPreferences& aIAPPreferences, TBool aEnableTimeout = ETrue);
1.175 -
1.176 - IMPORT_C void SSLQueueConnectL(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, const CImIAPPreferences& aIAPPreferences, const TDesC8& aSSLDomainName);
1.177 -
1.178 -/**
1.179 - @fn Disconnect()
1.180 - Intended Usage : To disconnect and close socket connection.
1.181 - Error Condition : None
1.182 - @since 6.0
1.183 - @pre None
1.184 - @post connection is closed.
1.185 - */
1.186 - IMPORT_C void Disconnect();
1.187 - IMPORT_C void Disconnect(TRequestStatus &aStatus);
1.188 - void TimeOut();
1.189 -
1.190 -
1.191 - IMPORT_C const TDesC& LocalName();
1.192 -/**
1.193 - This method should be called before Send/SendQueueReceive()
1.194 - TLS command is sent.
1.195 - @fn SetSSLTLSResponseL(const TDesC8& aDesc)
1.196 - Intended Usage : To use for secure connection.
1.197 - Error Condition : KErrNoMemory
1.198 - @since 6.2
1.199 - @param aDesc is the positive response the MTM expects from the connected
1.200 - server for TLS command. e.g. OK, +OK, 220 etc..
1.201 - @pre aDesc cannot be zero length
1.202 - @leave EImskNoTLSResponseString
1.203 - @post iTLSResponse is filled with aDesc contents
1.204 -
1.205 - */
1.206 - IMPORT_C void SetSSLTLSResponseL(const TDesC8& aDesc);
1.207 -
1.208 -/**
1.209 - @fn Send(TRequestStatus &aStatus, const TDesC8& aDesc)
1.210 - Intended Usage : To send data.
1.211 - Error Condition : None
1.212 - @since 6.0
1.213 - @param aStatus Asynchronous completion status
1.214 - @param aDesc is the aData to be sent
1.215 - @post None
1.216 -
1.217 - */
1.218 -
1.219 - //sends
1.220 - IMPORT_C void Send(TRequestStatus &aStatus, const TDesC8& aDesc);
1.221 - IMPORT_C void SendWithTimeout(TRequestStatus& aStatus, TInt aIdleTime, const TDesC8& aDesc);
1.222 - IMPORT_C void SendQueueReceiveWithTimeout(TRequestStatus& aStatus, TInt aIdleTime, const TDesC8& aDesc);
1.223 - IMPORT_C void Send(TRequestStatus &aStatus, TRefByValue<const TDesC8> aFmt,...);
1.224 -/**
1.225 - @fn SendQueueReceive(TRequestStatus &aStatus, const TDesC8& aDesc)
1.226 - Intended Usage : To send data and queue a receive.
1.227 - Error Condition : None
1.228 - @since 6.0
1.229 - @param aStatus Asynchronous completion status
1.230 - @param aDesc is the aData to be sent
1.231 - @post Sends the data and queues a receive.
1.232 - GetCurrentTextLine should be called after this method to read received data
1.233 - */
1.234 - IMPORT_C void SendQueueReceive(TRequestStatus &aStatus, const TDesC8& aDesc);
1.235 - IMPORT_C void SendQueueReceive(TRequestStatus &aStatus, TRefByValue<const TDesC8> aFmt,...);
1.236 -
1.237 - //receives
1.238 -/**
1.239 - Returns first full line of data received from socket to user
1.240 - @fn GetCurrentTextLine(TDes8& aDesc)
1.241 - Intended Usage : To return received data.
1.242 - Error Condition : None
1.243 - @since 6.0
1.244 - @param aDesc will be filled with received buffer
1.245 - @post returns the received buffer in the form of aDesc
1.246 - @return EReceiveBufferEmpty when received data is empty
1.247 - EBufferTooSmall when aDesc length is smaller than received data
1.248 - ECRLFTerminated when received data is complete (full line)
1.249 - EReceiveBufferFull when received data length is more than aDesc length
1.250 - GetCurrentTextLine should be called after Send methods
1.251 - */
1.252 - IMPORT_C TImLineType GetCurrentTextLine(TDes8& aDesc);
1.253 -/**
1.254 - User queues a new request from the socket (unless there's a full line of data in buffer
1.255 - then signal user and there's no need to make a receive request)
1.256 - @fn QueueReceiveNextTextLine(TRequestStatus &aStatus)
1.257 - Intended Usage : User queues a new request from the socket.
1.258 - Error Condition : None
1.259 - @since 6.0
1.260 - @param aStatus for asynchronous request
1.261 -
1.262 - */
1.263 - IMPORT_C void QueueReceiveNextTextLine(TRequestStatus &aStatus);
1.264 -/**
1.265 - @fn ReceiveBinaryData(TRequestStatus &aStatus, TDes8& aDes,TInt aLen)
1.266 - Intended Usage : Users queue a request for received data
1.267 - Error Condition : None
1.268 - @since 6.0
1.269 - @param aStatus Asynchronous completion status
1.270 - @param aDes is the aData to be received
1.271 - @param aLen is the length of the data the user wants to read
1.272 - @post aDes will be filled with received data of aLen.
1.273 - ReceiveBinaryData should be called after Send.
1.274 - */
1.275 - IMPORT_C void ReceiveBinaryData(TRequestStatus &aStatus, TDes8& aDes,TInt aLen);
1.276 -
1.277 - IMPORT_C void LogText(const TDesC8& aString); // write string into log file
1.278 - IMPORT_C void LogError(const TDesC8& aString,const TInt aError); // write string and integer into log file
1.279 -
1.280 -/**
1.281 - @fn GetIAPValue(TUint32 &aIAP)
1.282 - Intended Usage : Returns the IAP we are connecting/connected with in aIAP or returns an error code
1.283 - @since 6.0
1.284 - @param aIAP will be the current IAP
1.285 - @post aIAP will be filled with current IAP connected.
1.286 - @return will return genconn errors if any
1.287 - */
1.288 -
1.289 - IMPORT_C TInt GetIAPValue(TUint32 &aIAP);
1.290 -/**
1.291 - @fn GetRConnectionName(TName &aName)
1.292 - Intended Usage : Returns the name of the RConnection.
1.293 - @since 9.1
1.294 - @param aName Buffer in which the name is returned.
1.295 - @post aName will be filled with current name of the RConnection.
1.296 - @return KErrNone if successful, or another of the system-wide error codes.
1.297 - */
1.298 -
1.299 - IMPORT_C TInt GetRConnectionName(TName &aName);
1.300 -
1.301 -/** Returns the bearer type we are connected to with in aBearer or returns an error code */
1.302 - IMPORT_C TInt GetIAPBearer(TUint32 &aBearer);
1.303 -
1.304 -/**
1.305 - @internalTechnology
1.306 -
1.307 - @fn GetLastSocketActivityTimeout(TUint32& aTimeout)
1.308 - Intended Usage : Returns the last socket activity timeout value
1.309 - @since 9.1
1.310 - @param aTimeout is a return argument containing the timeout if it was found
1.311 - @post aTimeout will be filled with the timeout value
1.312 - @return Returns KErrNone, KErrNotFound or KErrBadHandle
1.313 - */
1.314 - IMPORT_C TInt GetLastSocketActivityTimeout(TUint32& aTimeout);
1.315 -
1.316 -/**
1.317 - @fn GetSocketServ()
1.318 - Intended Usage : Returns the Socket Server
1.319 - @since 8.0
1.320 - @return Socket Server
1.321 - */
1.322 - RSocketServ& GetSocketServ();
1.323 -
1.324 -/**
1.325 - @fn GetConnectionStage()
1.326 - Intended Usage : Gets the stage of the connection process obtained from RConnection
1.327 - @since 7.0s
1.328 - @return The current connection stage from RConnection or a system-wide error code.
1.329 -
1.330 - */
1.331 - IMPORT_C TInt GetConnectionStage();
1.332 -
1.333 -/**
1.334 - @fn SocketIdle()
1.335 - Intended Usage : disconnects the socket and notifies the observer when the socket has been idle
1.336 - for some time
1.337 - @since 7.0s
1.338 - */
1.339 - void SocketIdle();
1.340 -
1.341 -/**
1.342 - @fn SetPrimaryTextServerSession(CImTextServerSession& aPrimaryTextServerSession)
1.343 - Intended Usage : Users set only on the secondary session
1.344 - @since 9.2
1.345 - @param aPrimaryTextServerSession is PrimarySession's TextServerSession
1.346 - @pre None
1.347 - @post Going to be use on the secondary session
1.348 -*/
1.349 - IMPORT_C void SetPrimaryTextServerSession(CImTextServerSession* aPrimaryTextServerSession);
1.350 -
1.351 -/**
1.352 - @fn GetCImConnect()
1.353 - Intended Usage : Returns the CImConnect object
1.354 - @since 9.2
1.355 - @return CImConnect
1.356 - @post Going to be use on the secondary session
1.357 - */
1.358 - CImConnect* GetCImConnect();
1.359 -
1.360 -// Depreciated functions - do not use.
1.361 - IMPORT_C void QueueConnect(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, TBool aEnableTimeout = ETrue);
1.362 - IMPORT_C void QueueConnect(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, const CImIAPPreferences& aIAPPreferences, TInt aType, TBool aEnableTimeout = ETrue);
1.363 - IMPORT_C void QueueConnect(TRequestStatus& aStatus,const TDesC& anAddressDesc, TInt aPortNum, TCallBack aDisconnectFunction,const TUint32 aIntraddress,TInt aType, TBool aEnableTimeout = ETrue);
1.364 - IMPORT_C void QueueConnect(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum,const TUint32 aIAPaddress, TInt aType, TBool aEnableTimeout = ETrue);
1.365 - IMPORT_C void QueueConnect(TRequestStatus& aStatus,const TDesC& anAddressDesc, TInt aPortNum, TCallBack aDisconnectFunction, TBool aEnableTimeout = ETrue);
1.366 - IMPORT_C void QueueConnect(TRequestStatus& aStatus,const TDesC& anAddressDesc, TInt aPortNum, TCallBack aDisconnectFunction, const CImIAPPreferences& aIAPPreferences,TInt aType, TBool aEnableTimeout = ETrue);
1.367 - IMPORT_C TInt Send(const TDesC8& aDesc);
1.368 - IMPORT_C TInt Send(TRefByValue<const TDesC8> aFmt,...);
1.369 - IMPORT_C TInt SendReceive(const TDesC8& aDesc);
1.370 - IMPORT_C TInt Receive(TDes8& rDes);
1.371 - IMPORT_C void Receive(TRequestStatus &aStatus, TDes8& rDes);
1.372 - IMPORT_C static CImTextServerSession *NewLC (TImOperationMode aMode, RSocketServ &aServerServ);
1.373 - IMPORT_C static CImTextServerSession *NewL(RSocketServ &aServerServ);
1.374 - //Do not call SetSecurity. Call SetSSLTLSResponseL
1.375 - IMPORT_C TInt SetSecurity(TBool aSecurityOn, TBool aUnattendedMode = FALSE);
1.376 - IMPORT_C void PerformLogging(TBool aLogging);
1.377 -
1.378 -private:
1.379 -/**
1.380 - //cat Construction and Destruction
1.381 - @fn CImTextServerSession()
1.382 - Intended Usage : Constructor. First phase of two-phase construction method. Does
1.383 - non-allocating construction.
1.384 - @since 6.0
1.385 -
1.386 - */
1.387 - CImTextServerSession();
1.388 -
1.389 - CImTextServerSession(RSocketServ& aSocketServ, CImConnect& aConnect);
1.390 -/**
1.391 - //cat Construction
1.392 - @fn CImTextServerSession(TInt aSendIdleTime, TInt aReceiveIdleTime)
1.393 - Intended Usage : Constructor. First phase of two-phase construction method. Does
1.394 - non-allocating construction.
1.395 - @since 7.0s
1.396 - @param aSendIdleTime is the time for which the idle timer runs (for a send)
1.397 - @param aReceiveIdleTime is the time for which the idle timer runs (for a receive)
1.398 - */
1.399 - CImTextServerSession(TInt aSendIdleTime, TInt aReceiveIdleTime);
1.400 -
1.401 - CImTextServerSession(TInt aSendIdleTime, TInt aReceiveIdleTime, RSocketServ& aSocketServ, CImConnect& aConnect);
1.402 -
1.403 -/**
1.404 - //cat Construction and Destruction.
1.405 - @fn ConstructL()
1.406 - Intended Usage : Second phase of two-phase construction method. Does any
1.407 - allocations required to fully construct the object.
1.408 - @since 6.0
1.409 - @leave KErrNoMemory.
1.410 - @pre First phase of construction is complete
1.411 - @post The object is fully constructed and initialised.
1.412 - */
1.413 - void ConstructL();
1.414 -
1.415 - TInt Open();
1.416 - void Close();
1.417 -
1.418 - void CreateLogFile(TInt aPortNum);
1.419 - void OpenScriptFile(TInt aPortNum);
1.420 -
1.421 - void DoRunL();
1.422 - void DoComplete(TInt& aStatusValue); // Cleanup code
1.423 - void DoCancel();
1.424 -
1.425 - // these called from DoRunL;
1.426 - void SocketConnect();
1.427 - void DoConnectedToSocketL();
1.428 - void DoQueueConnect();
1.429 -
1.430 - void RealReceive(TDes8& aDesc);
1.431 - void RealSend(const TDesC8& aDesc);
1.432 -/**
1.433 - @fn ParseSSLTLSResponseL()
1.434 - Intended Usage : session will compare the response(for TLS command)
1.435 - with the MTMs response
1.436 - @since 6.2
1.437 - @leave KImskSSLTLSNegotiateFailed if the response doesn't match
1.438 - @post CSecureSocket object is created
1.439 - */
1.440 - void ParseSSLTLSResponseL();
1.441 -
1.442 -/**
1.443 - @fn CreateSecureSocketL()
1.444 - Intended Usage : to use secure socket connection
1.445 - @since 6.2
1.446 - @leave None
1.447 - @post CSecureSocket object is created and iSecurityState is set to EImSecurityStateOn;
1.448 - */
1.449 - void CreateSecureSocketL();
1.450 -
1.451 -/**
1.452 - @fn QueueGenericConnectL(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, const CImIAPPreferences& aIAPPreferences, TBool aEnableTimeout = ETrue)
1.453 - Intended Usage : Queue a standard or wrapped SSL connect on an socket assuming the socket is successfully opened. Called by SSLQueueConnectL and QueueConnectL
1.454 - Error Condition : KErrNoMemory, EImskSocketOpen
1.455 - @since 7.0s
1.456 - @param aStatus Asynchronous completion status
1.457 - @param anAddressDesc is the IP address
1.458 - @param aIAPPreferences is the IAP connection preference to be used
1.459 - @param aPortNum is the port number eg. 143, 993
1.460 - @param aSSLDomainName SSL domain name to use for secure sockets
1.461 - @pre None
1.462 - @post connection is ready to send and receive data.
1.463 - */
1.464 - void QueueGenericConnectL(TRequestStatus &aStatus,const TDesC& anAddressDesc, TInt aPortNum, const CImIAPPreferences& aIAPPreferences, const TDesC8& aSSLDomainName);
1.465 -
1.466 -#if defined(__IMSK_SIMULATION)
1.467 - void ReadNextPeriod();
1.468 - TUint32 GetTokenValue(TInt aTokenLen, const TPtrC8& aBuffer);
1.469 - TBool IsSuspended();
1.470 - TBool SuspendPeriodSet();
1.471 - void ResetSuspendPeriod();
1.472 - void SetAfterTimer();
1.473 - TInt ReadConfigNum(const TDesC& aName);
1.474 -#endif
1.475 -
1.476 - enum TImSocketState
1.477 - {
1.478 - EImClosed,
1.479 - EImResolve,
1.480 - EImConnect,
1.481 - EImSendReceive,
1.482 - EImDialUsingOverride,
1.483 - EImTLSHandShakeStarted,
1.484 - EImSendReceiveTimedOut
1.485 - };
1.486 -
1.487 - enum TImSendReceiveState
1.488 - {
1.489 - EImInactive,
1.490 - EImSending,
1.491 - EImReceiving,
1.492 - EImReceivingBinaryData,
1.493 - EImSendingQueueReceive,
1.494 - EImSuspended, //used when we are in a simulated GPRS suspend.
1.495 - };
1.496 -
1.497 - enum TImSecurityState
1.498 - {
1.499 - EImSecurityStateOff,
1.500 - EImSecurityStateOn,
1.501 - EImSecurityStateFailed
1.502 - };
1.503 -private:
1.504 - /** handle to the socket */
1.505 - RSocket iSocket;
1.506 - /** handle to RSocketServ */
1.507 - RSocketServ iServ;
1.508 - /** handle to Hostresolver */
1.509 - RHostResolver iHostResolver;
1.510 - /** handle to secure socket for SSL/TLS connection */
1.511 - CSecureSocket* iSecureSocket;
1.512 -
1.513 - TUint32 iCurrentIAPcache;
1.514 - /** Used to find if IAP is cached */
1.515 - TBool iIAPCached; // true if the above value can be used.
1.516 - /** result of the host resolver */
1.517 - TNameEntry iHostent;
1.518 - /** port number e.g. 25 for SMTP, 143 for IMAP and 110 for POP */
1.519 - TInt iPortNum;
1.520 - /** server address */
1.521 - TPtrC iAddressDesc;
1.522 - /** data returned by the socket */
1.523 - TImMailBuffer iReceive;
1.524 - TSockXfrLength iLen;
1.525 - TImSocketState iState;
1.526 - TImSendReceiveState iSendReceive;
1.527 -
1.528 - HBufC8* iBuffer;
1.529 - TImLineType iCurrentLineType;
1.530 -
1.531 - /** to log connection data */
1.532 - CImLog* iLog;
1.533 - /** IP address name */
1.534 - TBuf<KImskIPAddressLen> iLocalName;
1.535 - /** secure state i.e to use Secure socket */
1.536 -
1.537 - TImSecurityState iSecurityState;
1.538 - const CImIAPPreferences* iIAPPreferences;
1.539 -
1.540 - CImConnect* iConnect;
1.541 -
1.542 - TDes8* iReceiveData; // buffer we just recieved data into
1.543 -
1.544 -
1.545 - HBufC8* iSentData;
1.546 - /** response for different mail protocols like 220,+OK, OK, BAD */
1.547 - HBufC8* iTLSResponse; //response for different mail protocols like 220,+OK, OK, BAD
1.548 - /** internal flag to read tls response */
1.549 - TBool iReadTLSResponse;
1.550 - TBool iPerformLogging;
1.551 - TBool iWrappedSocket;
1.552 -
1.553 - CImSocketIdleTimer* iSocketIdleTimer;
1.554 - TTimeIntervalMicroSeconds32 iSendIdleTime;
1.555 - TTimeIntervalMicroSeconds32 iReceiveIdleTime;
1.556 -
1.557 - /** A shorter idle timeout, used when a fast response is expected */
1.558 - TTimeIntervalMicroSeconds32 iSendShortIdleTime;
1.559 - TTimeIntervalMicroSeconds32 iReceiveShortIdleTime;
1.560 -
1.561 -
1.562 -#ifdef __IMSK_SCRIPTING
1.563 - CImTextServerScript* iScript;
1.564 -#endif
1.565 -
1.566 -#if defined(__IMSK_SIMULATION)
1.567 -
1.568 - RFs iFs;
1.569 -
1.570 -
1.571 - TUint32 iScriptedIAP; // value to return for iap when scripting
1.572 - TUint32 iBearerIAP; // value to return for bearer when scripting
1.573 -
1.574 -
1.575 - TImSendReceiveState iSuspendedState;
1.576 -
1.577 - RTimer iSuspendTimer;
1.578 -
1.579 - RFile iGprsFile;
1.580 -
1.581 - TBool iGprsConfigExists;
1.582 -
1.583 - TInt iCfgFilePos;
1.584 -
1.585 - TTime iLastSuspend; // time last suspension took place
1.586 - // in universal time
1.587 -
1.588 - TTimeIntervalSeconds iStart; // number of seconds since last delay
1.589 - // before the following delay occurs.
1.590 - // if 0 no suspend is required.
1.591 - TTimeIntervalSeconds iDuration; // how long to delay. If 0 no suspend is
1.592 - // required
1.593 - TBool iRepeat; // repeat the above delay for an
1.594 - // infinite period
1.595 -
1.596 - HBufC8* iSendData; // suspended data
1.597 -#endif // __IMSK_SIMULATION
1.598 -
1.599 - CImTextServerSession* iPrimaryTextServerSession; //Only going to be set on the secondary session
1.600 -
1.601 - TBool iClientOwnsConnection;
1.602 -
1.603 - /** SSL domain name for secure sockets */
1.604 - HBufC8* iSSLDomainName;
1.605 - TBool iSocketIdleTimeSet; // iSocketIdleTimeSet=ETrue, if smtp server did not responds within 10 seconds after sending "."
1.606 - };
1.607 -
1.608 -#endif