commsfwsupport/commselements/serverden/src/sd_workersession.cpp
branchRCL_3
changeset 76 576874e13a2c
parent 70 b564fb5fd78b
child 84 486e9e9c45a7
equal deleted inserted replaced
73:5ebd530e523b 76:576874e13a2c
   692 	}
   692 	}
   693 
   693 
   694 EXPORT_C void CWorkerSubSession::ConstructL()
   694 EXPORT_C void CWorkerSubSession::ConstructL()
   695 	{
   695 	{
   696 	iSessionProxy = Player().CurrentSessionProxyL();
   696 	iSessionProxy = Player().CurrentSessionProxyL();
       
   697 	// Try reserving enough space in the transport sender queue so that we don't overflow the queue
       
   698 	// when sending messages in bulk, which can happen in cases like closing the session without 
       
   699 	// closing individual sub-sessions. Protyping reveals that with a high number of number of 
       
   700 	// sub-sessions, a transport queue length twice the number of active sub-session is a safe bet
       
   701 	CCommsTransport* transport = iPlayer->WorkerThread().Transport();
       
   702 	TInt numSubsession = iSession->SubSessions().ActiveCount() + 1;
       
   703 	const TInt numUndeliveredMessae = numSubsession * 2;
       
   704 	transport->PreallocateQueueSpaceL(numUndeliveredMessae);
   697 	}
   705 	}
   698 
   706 
   699 EXPORT_C CWorkerSubSession::~CWorkerSubSession()
   707 EXPORT_C CWorkerSubSession::~CWorkerSubSession()
   700 	{
   708 	{
   701 	// Session may be disappeared by now, so DO NOT USE IT
   709 	// Session may be disappeared by now, so DO NOT USE IT