networkprotocolmodules/suplprotocolmodule/SuplConnectionManager/src/suplconnectionmanager.cpp
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 #include <e32debug.h>
       
     2 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 // All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 //
       
     9 // Initial Contributors:
       
    10 // Nokia Corporation - initial contribution.
       
    11 //
       
    12 // Contributors:
       
    13 //
       
    14 // Description:
       
    15 //
       
    16 
       
    17 /**
       
    18  @file
       
    19  @internalComponent
       
    20  @deprecated
       
    21 */
       
    22 #include "suplconnectionmanager.h"
       
    23 #include "socketwriter.h"
       
    24 #include <lbs/lbshostsettingsclasstypes.h>
       
    25 #include "supldevloggermacros.h"
       
    26 
       
    27 EXPORT_C CSuplConnectionManager* CSuplConnectionManager::NewL()
       
    28 	{
       
    29 	SUPLLOG(ELogP1, "CSuplConnectionManager::NewL() Begin\n");
       
    30 	CSuplConnectionManager* self = new (ELeave)CSuplConnectionManager();
       
    31 	CleanupStack::PushL(self);
       
    32 	self->ConstructL();
       
    33 	SUPLLOG(ELogP1, "CSuplConnectionManager::NewL() End\n");
       
    34 	CleanupStack::Pop(self);
       
    35 	
       
    36 	return self;
       
    37 	}
       
    38 
       
    39 CSuplConnectionManager::CSuplConnectionManager() :
       
    40 	iSessionRecords(2), iSocketWriters(2), iSocketWriterNextIndex(0)
       
    41 	{
       
    42 	SUPLLOG(ELogP1, "CSuplConnectionManager::CSuplConnectionManager() Begin\n");
       
    43 	SUPLLOG(ELogP1, "CSuplConnectionManager::CSuplConnectionManager() End\n");
       
    44 	}
       
    45 
       
    46 void CSuplConnectionManager::ConstructL()
       
    47 	{
       
    48 	SUPLLOG(ELogP1, "CSuplConnectionManager::ConstructL() Begin\n");
       
    49 	// Open socket server
       
    50 	User::LeaveIfError(iSocketServ.Connect());
       
    51 	SUPLLOG(ELogP1, "CSuplConnectionManager::ConstructL() End\n");
       
    52 	}
       
    53 
       
    54 CSuplConnectionManager::~CSuplConnectionManager()
       
    55 	{
       
    56 	SUPLLOG(ELogP1, "CSuplConnectionManager::~CSuplConnectionManager() Begin\n");
       
    57 	// Delete array allocations
       
    58 	for (TInt x = 0; x < iSessionRecords.Count(); ++x)
       
    59 		{
       
    60 		delete iSessionRecords[x];
       
    61 		}
       
    62 	for (TInt x = 0; x < iSocketWriters.Count(); ++x)
       
    63 		{
       
    64 		delete iSocketWriters[x];
       
    65 		}
       
    66 	
       
    67 	iSessionRecords.Close();
       
    68 	iSocketWriters.Close();
       
    69 
       
    70 	iSocketServ.Close();
       
    71 	SUPLLOG(ELogP1, "CSuplConnectionManager::~CSuplConnectionManager() End\n");
       
    72 	}
       
    73 
       
    74 EXPORT_C void CSuplConnectionManager::Connect(const TSuplLocalSessionId& aSessionId, 
       
    75 											  const TLbsHostSettingsId& aSlpId,
       
    76 											  const CSuplSessionRecord::TServiceType& aServiceType,
       
    77 											  MSuplConnectionManagerObserver& aConnMgrObserver)
       
    78 	{
       
    79 	SUPLLOG(ELogP1, "CSuplConnectionManager::Connect() Begin\n");
       
    80 	Connect(aSessionId, aSlpId, aServiceType, aConnMgrObserver, EFalse);
       
    81 	SUPLLOG(ELogP1, "CSuplConnectionManager::Connect() End\n");
       
    82 	}
       
    83 
       
    84 void CSuplConnectionManager::Connect(const TSuplLocalSessionId& aSessionId, 
       
    85 		  							 const TLbsHostSettingsId& aSlpId,
       
    86 		  							 const CSuplSessionRecord::TServiceType& aServiceType,
       
    87 		  							 MSuplConnectionManagerObserver& aConnMgrObserver,
       
    88 		  							 TBool aForceNonSecure)
       
    89 	{
       
    90 	SUPLLOG(ELogP1, "CSuplConnectionManager::Connect() Begin\n");
       
    91 	TInt ignore;
       
    92 	CSocketWriterBase* socketWriter = FindWriter(aSlpId, ignore);
       
    93 	if (socketWriter == NULL)
       
    94 		{
       
    95 		// Get host settings for auth mode
       
    96 		TLbsHostSettingsSupl settings;
       
    97 		TRAPD(err, GetHostSettingsL(aSlpId, settings))
       
    98 		if (err == KErrNone)
       
    99 			{
       
   100 			// Check that port value has been set
       
   101 			TInt portValueInSettings;
       
   102 			settings.GetPortId(portValueInSettings);
       
   103 			if(portValueInSettings <= 0) // If SetPortId() was never called...
       
   104 				{
       
   105 				settings.SetPortId(7275); // set it to be the OMA specified port
       
   106 				}
       
   107 			
       
   108 			// Get the security settings
       
   109 			TLbsHostSettingsSupl::TAuthModes mode;
       
   110 			if (aServiceType == CSuplSessionRecord::EServiceMolr)
       
   111 				{
       
   112 				settings.GetAuthModesMOLR(mode);
       
   113 				}
       
   114 			else
       
   115 				{
       
   116 				settings.GetAuthModesMTLR(mode);
       
   117 				}
       
   118 			
       
   119 			// If forced into non-secure mode then check that the server supports this mode
       
   120 			if (!(aForceNonSecure && (mode & TLbsHostSettingsSupl::EAuthNone) == 0))
       
   121 				{
       
   122 				// Which socket to use?
       
   123 				TInt err = KErrNone;
       
   124 				// If forced into non-secure then use a normal socket, otherwise check to see if the 
       
   125 				// server supports any secure mode as these take precedence
       
   126 				if (aForceNonSecure || ((mode | TLbsHostSettingsSupl::EAuthNone) == TLbsHostSettingsSupl::EAuthNone))
       
   127 					{
       
   128 					TRAP(err, socketWriter = CSocketWriter::NewL(aSlpId, ++iSocketWriterNextIndex, *this, iSocketServ, settings));
       
   129 					}
       
   130 				else
       
   131 					{
       
   132 					TRAP(err, socketWriter = CSecureSocketWriter::NewL(aSlpId, ++iSocketWriterNextIndex, *this, iSocketServ, settings, aServiceType));
       
   133 					}
       
   134 				
       
   135 				if (err == KErrNone)
       
   136 					{
       
   137 					// Add to array of socket writers
       
   138 					if (iSocketWriters.Append(socketWriter) != KErrNone)
       
   139 						{
       
   140 						delete socketWriter;
       
   141 						socketWriter = NULL;
       
   142 						}
       
   143 					}
       
   144 				}
       
   145 			}
       
   146 		}
       
   147 	
       
   148 	CSuplSessionRecord* suplRecord = NULL;
       
   149 	if (socketWriter != NULL)
       
   150 		{
       
   151 		TRAP_IGNORE(suplRecord = CSuplSessionRecord::NewL(aConnMgrObserver, aSessionId, aSlpId, aServiceType, socketWriter->CallbackId()));
       
   152 		}
       
   153 	
       
   154 	if (suplRecord == NULL)
       
   155 		{
       
   156 		SUPLLOG(ELogP1, "CSuplConnectionManager::Connect() Error(EUndefinedConnectionError, 1)\n");
       
   157 		aConnMgrObserver.ConnectionError(MSuplConnectionManagerObserver::EUndefinedConnectionError);
       
   158 		}
       
   159 	else
       
   160 		{
       
   161 		if (iSessionRecords.Append(suplRecord) == KErrNone)
       
   162 			{
       
   163 			socketWriter->Connect(aSessionId);
       
   164 			}
       
   165 		else
       
   166 			{
       
   167 			delete suplRecord;
       
   168 			SUPLLOG(ELogP1, "CSuplConnectionManager::Connect() Error(EUndefinedConnectionError, 2)\n");
       
   169 			aConnMgrObserver.ConnectionError(MSuplConnectionManagerObserver::EUndefinedConnectionError);
       
   170 			}
       
   171 		}
       
   172 	SUPLLOG(ELogP1, "CSuplConnectionManager::Connect() End\n");
       
   173 	}
       
   174 
       
   175 EXPORT_C void CSuplConnectionManager::Disconnect(const TSuplLocalSessionId& aSessionId)
       
   176 	{
       
   177 	SUPLLOG(ELogP1, "CSuplConnectionManager::Disconnect() Begin\n");
       
   178 	TInt at = 0;
       
   179 	CSuplSessionRecord* sessionRecord = FindSession(aSessionId, at);
       
   180 	if (sessionRecord != NULL) // Cant really do anything if it dont exist!
       
   181 		{
       
   182 		// Disconnect the socket writer
       
   183 		TInt ignore;
       
   184 		CSocketWriterBase* writer = FindWriter(sessionRecord->SocketWriter(), ignore);
       
   185 		if (writer != NULL)
       
   186 			{
       
   187 			writer->Disconnect();
       
   188 			}
       
   189 		
       
   190 		// Remove from array
       
   191 		delete iSessionRecords[at];
       
   192 		iSessionRecords.Remove(at);
       
   193 		}
       
   194 	SUPLLOG(ELogP1, "CSuplConnectionManager::Disconnect() End\n");
       
   195 	}
       
   196 
       
   197 EXPORT_C void CSuplConnectionManager::SendMessage(const CSuplMessageBase* aMessage,
       
   198 												  const TSuplLocalSessionId& aSessionId)
       
   199 	{
       
   200 	SUPLLOG(ELogP1, "CSuplConnectionManager::SendMessage() Begin\n");
       
   201 	TInt ignore;
       
   202 	CSuplSessionRecord* sessionRecord = FindSession(aSessionId, ignore);
       
   203 	if (sessionRecord != NULL)
       
   204 		{
       
   205 		CSocketWriterBase* socketWriter = FindWriter(sessionRecord->SocketWriter(), ignore);
       
   206 		if (socketWriter != NULL)
       
   207 			{
       
   208 			CSuplMessageBase* message = const_cast<CSuplMessageBase*>(aMessage);
       
   209 			TRAPD(err, socketWriter->SendMessageL(message, aSessionId));
       
   210 			if (err != KErrNone)
       
   211 				{
       
   212 				SUPLLOG(ELogP1, "CSuplConnectionManager::SendMessage Error(EFailedToSend, 1)\n");
       
   213 				sessionRecord->Observer().ConnectionError(MSuplConnectionManagerObserver::EFailedToSend);
       
   214 				}
       
   215 			}
       
   216 		else
       
   217 			{
       
   218 			SUPLLOG(ELogP1, "CSuplConnectionManager::SendMessage Error(EFailedToSend, 2)\n");
       
   219 			sessionRecord->Observer().ConnectionError(MSuplConnectionManagerObserver::EFailedToSend);
       
   220 			}
       
   221 		}
       
   222 	SUPLLOG(ELogP1, "CSuplConnectionManager::SendMessage() End\n");
       
   223 	}
       
   224 	
       
   225 void CSuplConnectionManager::Connected(const TSuplLocalSessionId& aSessionId, TInetAddr& aAddr)
       
   226 	{
       
   227 	SUPLLOG(ELogP1, "CSuplConnectionManager::Connected() Begin\n");
       
   228 	TInt ignore;
       
   229 	CSuplSessionRecord* sessionRecord = FindSession(aSessionId, ignore);
       
   230 	if (sessionRecord != NULL)
       
   231 		{
       
   232 		sessionRecord->Observer().Connected(aAddr);
       
   233 		}
       
   234 	SUPLLOG(ELogP1, "CSuplConnectionManager::Connected() End\n");
       
   235 	}
       
   236 
       
   237 /**
       
   238  * If final parameter(aDelete) is set to True on return then the calling object should delete itself, as
       
   239  * it is no longer stored in the list of available connections.
       
   240  */
       
   241 
       
   242 void CSuplConnectionManager::ConnectionError(const TInt& aError, const TInt aSocketWriterId, 
       
   243 											 const TSuplLocalSessionId& aSessionId, TBool& aDelete)
       
   244 	{
       
   245 	aDelete = EFalse;
       
   246 	SUPLLOG2(ELogP1, "CSuplConnectionManager::ConnectionError() Begin, aError: %d\n", aError);
       
   247 	switch (aError)
       
   248 		{
       
   249 		case MSuplSocketObserver::EDisconnected:
       
   250 			{
       
   251 			// Ignore this. The socket writer will have disconnected from the server, but we wish to keep the socket
       
   252 			// writer around as it stores connection information. 
       
   253 			break;
       
   254 			}
       
   255 		case MSuplSocketObserver::EFailedToSend:
       
   256 			{
       
   257 			TInt ignore;
       
   258 			CSuplSessionRecord* session = FindSession(aSessionId, ignore);
       
   259 			if (session != NULL)
       
   260 				{
       
   261 				session->Observer().ConnectionError(MSuplConnectionManagerObserver::EFailedToSend);
       
   262 				} // if
       
   263 			else
       
   264 				{
       
   265 				__ASSERT_DEBUG(EFalse, User::Invariant());
       
   266 				}
       
   267 			break;
       
   268 			}
       
   269 		case MSuplSocketObserver::EFailedToHandshake:
       
   270 		case MSuplSocketObserver::EFailedCertCheck:
       
   271 			{
       
   272 			// Attemp a non-secure connection
       
   273 			TInt sessionAt = 0;
       
   274 			CSuplSessionRecord* session = FindSession(aSessionId, sessionAt);
       
   275 			if (session != NULL)
       
   276 				{
       
   277 				// Delete Originals
       
   278 				TInt writerAt = 0;
       
   279 				CSocketWriterBase* socketWriter = FindWriter(aSocketWriterId, writerAt);
       
   280 				if (socketWriter != NULL)
       
   281 					{
       
   282 					aDelete = ETrue;
       
   283 					iSocketWriters.Remove(writerAt);
       
   284 					}
       
   285 				
       
   286 				iSessionRecords.Remove(sessionAt);
       
   287 				
       
   288 				Connect(aSessionId, session->SlpId(), session->ServiceMode(), session->Observer(), ETrue);
       
   289 				
       
   290 				delete session;
       
   291 				}
       
   292 			break;
       
   293 			}
       
   294 		case MSuplSocketObserver::ETimeOut:
       
   295 			{
       
   296 			TInt ignore;
       
   297 			CSuplSessionRecord* session = FindSession(aSessionId, ignore);
       
   298 			if (session != NULL)
       
   299 				{
       
   300 				session->Observer().ConnectionError(MSuplConnectionManagerObserver::EConnectionLost);
       
   301 				}
       
   302 			else
       
   303 				{
       
   304 				__ASSERT_DEBUG(EFalse, User::Invariant());
       
   305 				}
       
   306 			break;
       
   307 			}
       
   308 		case MSuplSocketObserver::EFailedToRead:
       
   309 			{
       
   310 			// Loop through the sessions and inform them of the error
       
   311 			for (TInt x = 0; x < iSessionRecords.Count(); ++x)
       
   312 				{
       
   313 				if (iSessionRecords[x]->SocketWriter() == aSocketWriterId)
       
   314 					{
       
   315 					iSessionRecords[x]->Observer().ConnectionError(MSuplConnectionManagerObserver::EUndefinedConnectionError);
       
   316 					} // if
       
   317 				} // for			
       
   318 			break;
       
   319 			}
       
   320 		case MSuplSocketObserver::EFailedToDecode:
       
   321 		case MSuplSocketObserver::ETooMuchDataRead:
       
   322 			{
       
   323 			TInt ignore;
       
   324 			CSuplSessionRecord* session = FindSession(aSessionId, ignore);
       
   325 			if (session != NULL)
       
   326 				{
       
   327 				session->Observer().ConnectionError(MSuplConnectionManagerObserver::EDecodeMessageFailed);
       
   328 				}
       
   329 			else
       
   330 				{
       
   331 				__ASSERT_DEBUG(EFalse, User::Invariant());
       
   332 				}
       
   333 			break;
       
   334 			}
       
   335 		case MSuplSocketObserver::ESocketError:
       
   336 		case KErrCouldNotConnect:
       
   337 		case KErrNotFound:
       
   338 		default:
       
   339 			{
       
   340 			TInt ignore;
       
   341 			CSuplSessionRecord* session = FindSession(aSessionId, ignore);
       
   342 			if (session != NULL)
       
   343 				{
       
   344 				session->Observer().ConnectionError(MSuplConnectionManagerObserver::EUndefinedConnectionError);
       
   345 				}
       
   346 			else
       
   347 				{
       
   348 				__ASSERT_DEBUG(EFalse, User::Invariant());
       
   349 				}			
       
   350 			break;
       
   351 			}
       
   352 		}
       
   353 	SUPLLOG(ELogP1, "CSuplConnectionManager::ConnectionError() End\n");
       
   354 	}
       
   355 
       
   356 void CSuplConnectionManager::MessageReceived(CSuplMessageBase* aSuplMessage)
       
   357 	{
       
   358 	SUPLLOG(ELogP1, "CSuplConnectionManager::MessageReceived() Begin\n");
       
   359 	// Which session?
       
   360 	CSuplSessionId* sessionId = NULL;	
       
   361 	TRAPD(err, sessionId = CSuplSessionId::NewL());
       
   362 	if (err == KErrNone)
       
   363 		{
       
   364 		aSuplMessage->GetSessionId(*sessionId);
       
   365 		
       
   366 		TInt ignore;
       
   367 		CSuplSessionRecord* session = FindSession(sessionId->iSetSessionId->iSessionId, ignore);
       
   368 		if (session != NULL)
       
   369 			{
       
   370 			session->Observer().MessageReceived(aSuplMessage);
       
   371 			}
       
   372 		delete sessionId;
       
   373 		}
       
   374 	SUPLLOG(ELogP1, "CSuplConnectionManager::MessageReceived() End\n");
       
   375 	}
       
   376 
       
   377 CSuplSessionRecord* CSuplConnectionManager::FindSession(TLbsHostSettingsId aId, TInt& aIndex)
       
   378 	{
       
   379 	SUPLLOG(ELogP1, "CSuplConnectionManager::FindSession() Begin\n");
       
   380 	for (TInt x = 0; x < iSessionRecords.Count(); ++x)
       
   381 		{
       
   382 		if (iSessionRecords[x]->SlpId() == aId)
       
   383 			{
       
   384 			aIndex = x;
       
   385 			return iSessionRecords[x]; 
       
   386 			}
       
   387 		}
       
   388 
       
   389 	SUPLLOG(ELogP1, "CSuplConnectionManager::FindSession() End\n");
       
   390 
       
   391 	return NULL;
       
   392 	}
       
   393 
       
   394 CSuplSessionRecord* CSuplConnectionManager::FindSession(TSuplLocalSessionId aSessionId, TInt& aIndex)
       
   395 	{
       
   396 	SUPLLOG(ELogP1, "CSuplConnectionManager::FindSession() Begin\n");
       
   397 	for (TInt x = 0; x < iSessionRecords.Count(); ++x)
       
   398 		{
       
   399 		if (iSessionRecords[x]->SessionId() == aSessionId)
       
   400 			{
       
   401 			aIndex = x;
       
   402 			return iSessionRecords[x];
       
   403 			}
       
   404 		}
       
   405 
       
   406 
       
   407     if (1 == iSessionRecords.Count())
       
   408 	    {
       
   409 	    // If only one session record exists, select it even
       
   410 	    // if the session Id doesn't match (possible corruption
       
   411 	    // of session ID. The observer will deal with the 
       
   412 	    // session mismatch).
       
   413 		aIndex = 0;
       
   414 		return iSessionRecords[0];	    
       
   415 	    }
       
   416 
       
   417 	SUPLLOG(ELogP1, "CSuplConnectionManager::FindSession() End\n");
       
   418 
       
   419 	return NULL;
       
   420 	}
       
   421 
       
   422 CSocketWriterBase* CSuplConnectionManager::FindWriter(TLbsHostSettingsId aId, TInt& aIndex)
       
   423 	{
       
   424 	SUPLLOG(ELogP1, "CSuplConnectionManager::FindWriter() Begin\n");
       
   425 	for (TInt x = 0; x < iSocketWriters.Count(); ++x)
       
   426 		{
       
   427 		if (iSocketWriters[x]->HostSettingsId() == aId)
       
   428 			{
       
   429 			aIndex = x;
       
   430 			return iSocketWriters[x];
       
   431 			}
       
   432 		}
       
   433 
       
   434 	SUPLLOG(ELogP1, "CSuplConnectionManager::FindWriter() End\n");	
       
   435 	return NULL;
       
   436 	}
       
   437 
       
   438 CSocketWriterBase* CSuplConnectionManager::FindWriter(TInt aId, TInt& aIndex)
       
   439 	{
       
   440 	SUPLLOG(ELogP1, "CSuplConnectionManager::FindWriter() Begin\n");
       
   441 	for (TInt x = 0; x < iSocketWriters.Count(); ++x)
       
   442 		{
       
   443 		if (iSocketWriters[x]->CallbackId() == aId)
       
   444 			{
       
   445 			aIndex = x;
       
   446 			return iSocketWriters[x];
       
   447 			}
       
   448 		}
       
   449 	
       
   450 	SUPLLOG(ELogP1, "CSuplConnectionManager::FindWriter() End\n");
       
   451 
       
   452 	return NULL;
       
   453 
       
   454 	}
       
   455 
       
   456 
       
   457 void CSuplConnectionManager::GetHostSettingsL(TLbsHostSettingsId aId, TLbsHostSettingsSupl& aSettings)
       
   458 	{
       
   459 	SUPLLOG(ELogP1, "CSuplConnectionManager::GetHostSettingsL() Begin\n");
       
   460 	// Open the host store
       
   461 	CLbsHostSettingsStore* pHostStore = CLbsHostSettingsStore::NewL(KLbsHostSettingsSuplStoreId);
       
   462 	CleanupStack::PushL(pHostStore);
       
   463 	
       
   464 	// Get the host settings
       
   465 	User::LeaveIfError(pHostStore->GetHostSettings(aId, aSettings));
       
   466 	
       
   467 	CleanupStack::PopAndDestroy(pHostStore);
       
   468 	SUPLLOG(ELogP1, "CSuplConnectionManager::GetHostSettingsL() End\n");
       
   469 	}
       
   470 
       
   471 
       
   472 
       
   473 
       
   474 /*
       
   475  * CSuplSessionRecord 
       
   476  */
       
   477 CSuplSessionRecord* CSuplSessionRecord::NewL(MSuplConnectionManagerObserver& aObserver,
       
   478 					   						 const TSuplLocalSessionId& aSessionId,
       
   479 					   						 const TLbsHostSettingsId& aSlpId,
       
   480 					   						 const TServiceType aServiceType,
       
   481 					   						 TUint  aSocketWriterIndex)
       
   482 	{
       
   483 	SUPLLOG(ELogP1, "CSuplSessionRecord::NewL()\n");
       
   484 	CSuplSessionRecord* self = new(ELeave) CSuplSessionRecord(aObserver, aSessionId, 
       
   485 															  aSlpId, aServiceType, aSocketWriterIndex);
       
   486 	return self;
       
   487 	}
       
   488 
       
   489 CSuplSessionRecord::~CSuplSessionRecord()
       
   490 	{
       
   491 	SUPLLOG(ELogP1, "CSuplSessionRecord::~CSuplSessionRecord() Begin\n");
       
   492 	SUPLLOG(ELogP1, "CSuplSessionRecord::~CSuplSessionRecord() End\n");
       
   493 	}
       
   494 
       
   495 CSuplSessionRecord::CSuplSessionRecord(MSuplConnectionManagerObserver& aObserver,
       
   496 					   				   const TSuplLocalSessionId& aSessionId,
       
   497 					   				   const TLbsHostSettingsId& aSlpId,
       
   498 					   				   const TServiceType aServiceType,
       
   499 					   				   TUint aSocketWriterIndex) :
       
   500 	iObserver(aObserver), iSessionId(aSessionId),
       
   501 	iSlpId(aSlpId), iServiceType(aServiceType), iSocketWriterIndex(aSocketWriterIndex)	
       
   502 	{
       
   503 	SUPLLOG(ELogP1, "CSuplSessionRecord::CSuplSessionRecord() Begin\n");
       
   504 	SUPLLOG(ELogP1, "CSuplSessionRecord::CSuplSessionRecord() End\n");
       
   505 	}
       
   506 
       
   507 MSuplConnectionManagerObserver& CSuplSessionRecord::Observer() const
       
   508 	{
       
   509 	SUPLLOG(ELogP1, "CSuplSessionRecord::Observer() Begin\n");
       
   510 	SUPLLOG(ELogP1, "CSuplSessionRecord::Observer() End\n");
       
   511 	return iObserver;
       
   512 	}
       
   513 
       
   514 const TSuplLocalSessionId& CSuplSessionRecord::SessionId() const
       
   515 	{
       
   516 	SUPLLOG(ELogP1, "CSuplSessionRecord::SessionId() Begin\n");
       
   517 	SUPLLOG(ELogP1, "CSuplSessionRecord::SessionId() End\n");
       
   518 	return iSessionId;
       
   519 	}
       
   520 
       
   521 const TLbsHostSettingsId CSuplSessionRecord::SlpId() const
       
   522 	{
       
   523 	SUPLLOG(ELogP1, "CSuplSessionRecord::SlpId() Begin\n");
       
   524 	SUPLLOG(ELogP1, "CSuplSessionRecord::SlpId() End\n");
       
   525 	return iSlpId;
       
   526 	}
       
   527 
       
   528 TUint CSuplSessionRecord::SocketWriter() const
       
   529 	{
       
   530 	SUPLLOG(ELogP1, "CSuplSessionRecord::SocketWriter() Begin\n");
       
   531 	SUPLLOG(ELogP1, "CSuplSessionRecord::SocketWriter() End\n");
       
   532 	return iSocketWriterIndex;
       
   533 	}
       
   534 
       
   535 CSuplSessionRecord::TServiceType CSuplSessionRecord::ServiceMode() const
       
   536 	{
       
   537 	SUPLLOG(ELogP1, "CSuplSessionRecord::ServiceMode() Begin\n");
       
   538 	SUPLLOG(ELogP1, "CSuplSessionRecord::ServiceMode() End\n");
       
   539 	return iServiceType;
       
   540 	}