Msrp/MsrpServer/inc/CMSRPServerSubSession.h
author Petteri Saari <petteri.saari@digia.com>
Thu, 02 Dec 2010 15:23:48 +0200
branchMSRP_FrameWork
changeset 60 7634585a4347
parent 58 cdb720e67852
permissions -rw-r--r--
This release addresses the following: - Multiple concurrent file transfer bug fixes. i.e. one device is concurrently receiving multiple files from multiple devices
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
     1
/*
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
     2
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
     3
* All rights reserved.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
     4
* This component and the accompanying materials are made available
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
     6
* which accompanies this distribution, and is available
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html."
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
     8
* Initial Contributors:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
     9
* Nokia Corporation - initial contribution.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    10
* Contributors:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    11
*
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    12
* Description:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    13
* MSRP Implementation
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    14
*
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    15
*/
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    16
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    17
#ifndef CMSRPSERVERSUBSESSION_H_
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    18
#define CMSRPSERVERSUBSESSION_H_
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    19
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    20
#include <e32std.h>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    21
#include <e32base.h>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    22
#include <e32math.h>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    23
#include <in_sock.h>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    24
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    26
#include "MMSRPConnectionObserver.h"
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    27
#include "MMSRPMessageObserver.h"
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    28
#include "MSRPServerCommon.h"
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    29
#include "CMSRPMessageHandler.h"
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    30
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    31
const TInt KMSRPSessIdLength=12;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    32
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    33
// Forward Declarations
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    34
class CMSRPServerSubSession;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    35
class CMSRPServerSession;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    36
class MMSRPConnectionManager;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    37
class CMSRPMessageBase;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    38
class MMSRPConnection;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    39
class MMSRPIncomingMessage;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    40
class CMSRPMessageHandler;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    41
class CMSRPFromToHeaderBase;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    42
class CMSRPToPathHeader;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    43
class CMSRPHeaderBase;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    44
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    45
class TStateBase;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    46
class CStateFactory;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    47
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    48
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    49
class CRMessageContainer: public CBase
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    50
{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    51
public:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    52
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    53
	CRMessageContainer();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    54
	~CRMessageContainer();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    55
	TBool set(const RMessage2& aMessage);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    56
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    57
	TInt CRMessageContainer::Write(TInt aParam,const TDesC8& aDes,TInt aOffset=0) const;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    58
	void ReadL(TInt aParam,TDes8& aDes,TInt aOffset=0) const;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    59
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    60
	void Complete(TInt aReason);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    61
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    62
	TBool Check(); 	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    63
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    64
	TBool iStatus; 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    65
	RMessage2 iMsg;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    66
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    67
};
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    68
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    69
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    70
template <class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    71
class CQueue : public CBase
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    72
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    73
	public:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    74
		inline CQueue();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    75
		virtual ~CQueue(){};
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    76
		inline TBool Queue(T& element);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    77
		inline T* DeQueue();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    78
		inline TBool isEmpty();
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
    79
        inline T* FindElement( T* aMatch );
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
    80
        inline T* FindElement( TDesC8& aMessageId );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    81
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    82
		inline T* getHead();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    83
		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    84
		virtual inline T* getMatch(T* aMatch);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    85
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    86
		TInt inline Length(){
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    87
						#ifdef _DEBUG
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    88
						if(0 == iQLenght && !iList.IsEmpty())
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    89
							{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    90
								MSRPLOG("CQueue::Lenght!! Problem!! in the queue lenght calculations");			
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    91
							}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    92
						#endif
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    93
						return iQLenght;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    94
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    95
						};
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    96
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    97
		inline void CQueue<T>::Destroy();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    98
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
    99
	protected:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   100
		TInt iQLenght;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   101
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   102
		TSglQue<T> iList;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   103
		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   104
	};
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   105
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   106
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   107
template <class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   108
CQueue<T>::CQueue(): iList(T::LinkOffset()),iQLenght(0){}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   109
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   110
template <class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   111
TBool CQueue<T>::Queue(T& element)
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   112
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   113
	iList.AddLast(element);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   114
	iQLenght++;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   115
	return TRUE;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   116
	}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   117
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   118
template <class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   119
T* CQueue<T>::DeQueue()
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   120
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   121
	T* element = NULL;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   122
	if(!(iList.IsEmpty()))
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   123
		{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   124
		element = iList.First();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   125
		iList.Remove(*element);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   126
		iQLenght--;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   127
		}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   128
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   129
	return element;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   130
	}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   131
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   132
template <class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   133
TBool CQueue<T>::isEmpty()
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   134
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   135
		return iList.IsEmpty();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   136
	}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   137
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   138
template <class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   139
T* CQueue<T>::getHead()
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   140
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   141
		T* element = NULL;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   142
		if(!(iList.IsEmpty()))
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   143
		{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   144
		element = iList.First();		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   145
		}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   146
		return element;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   147
	}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   148
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   149
template <class T>
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   150
T* CQueue<T>::FindElement( T* aMatch )
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   151
    {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   152
    if( !iList.IsEmpty() )
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   153
        {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   154
        TSglQueIter<T> iterator(CQueue<T>::iList);
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   155
        iterator.SetToFirst();
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   156
        T* matchingOwner;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   157
        
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   158
        while( ( matchingOwner = iterator++ ) )
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   159
            {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   160
            if( matchingOwner == aMatch )
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   161
                {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   162
                return matchingOwner;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   163
                }
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   164
            }
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   165
        }
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   166
    return NULL;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   167
    }
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   168
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   169
template <class T>
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   170
T* CQueue<T>::FindElement( TDesC8& aMessageId )
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   171
    {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   172
    if( !iList.IsEmpty() )
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   173
        {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   174
        TSglQueIter<T> iterator(CQueue<T>::iList);
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   175
        iterator.SetToFirst();
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   176
        T* currentElement;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   177
        
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   178
        while( ( currentElement = iterator++ ) )
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   179
            {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   180
            HBufC8* messageId = currentElement->MessageIdLC();
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   181
            if ( *messageId == aMessageId )
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   182
                {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   183
                CleanupStack::PopAndDestroy( ); // messageId
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   184
                return currentElement;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   185
                }
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   186
            CleanupStack::PopAndDestroy( ); // messageId
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   187
            }
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   188
        }
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   189
        
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   190
    return NULL;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   191
    }
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   192
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   193
template <class T>
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   194
T* CQueue<T>::getMatch(T* aMatch)	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   195
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   196
		aMatch;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   197
		return NULL;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   198
	}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   199
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   200
template<class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   201
inline void CQueue<T>::Destroy()
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   202
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   203
	T* element = NULL;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   204
	TSglQueIter<T> iter(iList);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   205
	element = iter++;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   206
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   207
	while(element)
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   208
		{		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   209
		iList.Remove(*element);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   210
		delete element;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   211
		element = iter++;	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   212
		iQLenght--;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   213
		}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   214
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   215
	}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   216
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   217
template<class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   218
class CQueueMsgHandlers : public CQueue<T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   219
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   220
	public:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   221
		CQueueMsgHandlers();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   222
		virtual ~CQueueMsgHandlers(){};
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   223
		virtual inline T* getMatch(T*);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   224
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   225
		virtual inline TBool explicitRemove(T* aElementToRemove);		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   226
		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   227
	};
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   228
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   229
template<class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   230
CQueueMsgHandlers<T>::CQueueMsgHandlers() : CQueue<T>::CQueue(){}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   231
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   232
template<class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   233
T*	CQueueMsgHandlers<T>::getMatch(T* aInCommingMsg)
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   234
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   235
		// 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   236
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   237
		TSglQueIter<T> iterator(CQueue<T>::iList);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   238
		iterator.SetToFirst();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   239
		T* iMatchingOwner;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   240
		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   241
		while((iMatchingOwner = iterator++))
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   242
			{
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   243
			if ( iMatchingOwner != aInCommingMsg )
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   244
			    {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   245
                if(iMatchingOwner->IsOwnerOfResponse(*aInCommingMsg))
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   246
                    {
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   247
                    return iMatchingOwner;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   248
                    }
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   249
                }
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   250
			}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   251
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   252
		return NULL;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   253
	}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   254
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   255
template<class T>
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   256
TBool CQueueMsgHandlers<T>::explicitRemove(T* aElementToRemove)
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   257
	{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   258
	CQueue<T>::iList.Remove(*aElementToRemove);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   259
	CQueue<T>::iQLenght--;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   260
		return TRUE;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   261
		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   262
	}
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   263
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   264
class CMSRPServerSubSession : public CBase, MMSRPConnectionObserver, MMSRPMessageObserver
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   265
    {
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   266
public:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   267
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   268
	enum TQueueType
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   269
		{
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   270
		TClientQueue,
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   271
		TInCommingMsgQueue,
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   272
		TCompletedSendQueue,
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   273
        TCompletedIncQueue,
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   274
		TReceiveProgressQueue,
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   275
		TSendProgressQueue
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   276
		};
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   277
	
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   278
    static CMSRPServerSubSession* NewL( 
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   279
            CMSRPServerSession& aServerSession, CStateFactory& aStateFactory, const TDesC8& aSessionId );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   280
    
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   281
    static CMSRPServerSubSession* NewLC( 
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   282
            CMSRPServerSession& aServerSession, CStateFactory& aStateFactory, const TDesC8& aSessionId );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   283
       
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   284
    virtual ~CMSRPServerSubSession( );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   285
       
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   286
    void ServiceL( const RMessage2& aMessage );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   287
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   288
	// From MMSRPConnectionObserver
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   289
	void ConnectionStateL( TInt aNewState, TInt aStatus );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   290
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   291
	TBool MessageReceivedL( CMSRPMessageHandler* aMsg );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   292
	       
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   293
	void UnclaimedMessageL( CMSRPMessageHandler* aMsg );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   294
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   295
	// From MMSRPMsgObserver
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   296
	void MessageSendCompleteL( CMSRPMessageHandler* aMessageHandler );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   297
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   298
	void MessageResponseSendCompleteL(CMSRPMessageHandler& aMsg);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   299
	
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   300
    void MessageReportSendCompleteL( CMSRPMessageHandler& aMsg );
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   301
	
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   302
	void MessageSendProgressL( CMSRPMessageHandler* aMessageHandler );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   303
	
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   304
	void MessageReceiveProgressL( CMSRPMessageHandler* aMessageHandler );
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   305
	
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   306
	void MessageCancelledL( );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   307
		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   308
	void WriterError();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   309
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   310
private:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   311
    CMSRPServerSession& iServerSession;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   312
    CMSRPServerSubSession( CMSRPServerSession& aServerSession, CStateFactory &aStateFactory);
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   313
    void ConstructL( const TDesC8& aSessionId );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   314
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   315
	// ProcessEventL shall only take a event. The data associated with the event can be a 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   316
	// RMessage(Client to Server events), CSendBuffer(buffer being send out by connection manager), 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   317
	// CMSRPMessage(received message) or other such data.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   318
	// The associated data is stored in the context and retrieved by the relevant state when needed.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   319
	
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   320
	void CMSRPServerSubSession::ProcessEventL( TMSRPFSMEvent aEvent);
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   321
        
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   322
	//HBufC8* CreateSubSessionIDL( );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   323
    
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   324
    void HandleLocalPathRequestL( const RMessage2& aMessage );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   325
       
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   326
    void HandleConnectRequestL( const RMessage2& aMessage );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   327
        
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   328
    void HandleListenConnectionsL( const RMessage2& aMessage );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   329
    void HandleListenMessagesL( const RMessage2& aMessage );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   330
    void HandleListenSendResultL( const RMessage2& aMessage );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   331
       
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   332
    void HandleSendMessageL( const RMessage2& aMessage );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   333
        
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   334
    void HandleCancelSendingL( const RMessage2& aMessage );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   335
    void HandleCancelReceivingL( const RMessage2& aMessage );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   336
    void HandleCancelSendRespListening( const RMessage2& aMessage );        
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   337
        
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   338
    MMSRPConnectionManager& ConnectionManager( );
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   339
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   340
	void CompleteClient(TInt aReason);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   341
	TInt Write(TInt aParam,const TDesC8& aDes);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   342
		
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   343
	TBool QueueClientSendRequestsL();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   344
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   345
	TBool QueueSendMessages(CMSRPMessageHandler* aMessageHandlers);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   346
	CMSRPMessageHandler* DeQueueSentMessage();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   347
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   348
	TBool QueueReceivedMessages();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   349
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   350
	// Utility functions.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   351
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   352
	void sendResultToClientL(CMSRPMessageHandler *incommingMsgHandler);
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   353
	TBool sendMsgToClientL(CMSRPMessageHandler *incommingMsgHandler);
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   354
    TBool sendReportToClientL( CMSRPMessageHandler *incommingMsgHandler );
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   355
	void SendProgressToClientL( CMSRPMessageHandler* aMessageHandler );
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   356
	void ReceiveProgressToClientL( CMSRPMessageHandler* aMessageHandler );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   357
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   358
	void ReadSendDataPckgL();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   359
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   360
	TBool listnerSetupComplete();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   361
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   362
	CMSRPServerSubSession::TQueueType getQToProcess();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   363
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   364
	TBool QueuesEmpty();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   365
	TBool informConnectionReadyToClient();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   366
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   367
	void QueueLog();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   368
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   369
    /**
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   370
    * Checks that incoming messages session id is a correct one for
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   371
    * this session
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   372
    * @param aMsgHandler message handler containing the incoming message
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   373
    * @return true if message belongs to this session, false if not
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   374
    */
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   375
    TBool CheckMessageSessionIdL( CMSRPMessageHandler *aMsgHandler );
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   376
	TBool matchSessionIDL(const CMSRPHeaderBase *aPathHeader, TBool local = TRUE);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   377
	TPtrC8 extractSessionID(const TDesC8& aPathBuffer);
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   378
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   379
	CStateFactory& StateFactory();
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   380
        
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   381
private:
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   382
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   383
	// Session Data.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   384
    HBufC8* iLocalSessionID;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   385
    HBufC8* iRemoteSessionID;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   386
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   387
	// Connection info bundle.        
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   388
    TBuf8< KMaxLengthOfHost > iRemoteHost;            
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   389
    TUint iRemotePort;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   390
	TConnectionDirection  iConnDirection;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   391
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   392
	// Local Host info
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   393
    TBuf< KMaxLengthOfHost > iLocalHost;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   394
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   395
	MMSRPConnection* iConnection;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   396
						    
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   397
	// connect package from the client
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   398
	TPckgBuf< TLocalPathMSRPData > iLocalPathMSRPDataPckg;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   399
	TPckgBuf< TConnectMSRPData > iConnectMSRPdataPckg;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   400
        
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   401
    // listen package from the client
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   402
    TPckgBuf< TListenMSRPData > iListenMSRPdataPckg;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   403
        
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   404
    // send package to the client
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   405
    TPckgBuf< TSendMSRPData > iSendMSRPdataPckg;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   406
        
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   407
    // result of sent messages package to the client
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   408
    TPckgBuf< TListenSendResultMSRPData > iSendResultListenMSRPDataPckg;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   409
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   410
	// Temorary Event Data.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   411
	const RMessage2* iClientMessage;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   412
	CMSRPMessageHandler* iReceivedMsg;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   413
	CMSRPMessageHandler* iReceivedResp;
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   414
    CMSRPMessageHandler* iReceivedReport;
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   415
	CMSRPMessageHandler* iReceiveFileMsgHdler;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   416
	TBool iSendCompleteNotify; //
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   417
	TBool iReceiveCompleteNotify;
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   418
	TBool iFileShareCancelled;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   419
	
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   420
	// used for progress reports, temporary, not owned
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   421
    CMSRPMessageHandler* iReceiveProgressMsg;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   422
    
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   423
    // used for progress reports, temporary, not owned
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   424
    CMSRPMessageHandler* iSendProgressMsg;
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   425
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   426
	// Client Listners waiting to be completed.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   427
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   428
	// Listner for response of Connect request.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   429
	CRMessageContainer iConnectionListner; 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   430
	// Listner for response of Listen request(iMessage set as false) and also 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   431
	// listner for incomming messages(iMessage set as TRUE).
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   432
	CRMessageContainer iIncommingMessageListner;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   433
	// Listner for Responses to sent messages.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   434
	CRMessageContainer iResponseListner;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   435
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   436
	CStateFactory& iStateFactory;	// Not owned.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   437
	TStateBase* iState;				// Not owned.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   438
	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   439
	// The current message handler that is doing a MSRP Send and 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   440
	// for which the subsession has still not rerceived a sendmessagecomplete event.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   441
	// Once the sendmessage completed is received the message handler is put on the 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   442
	// OutGoingMessage queue where it waits for a response to arrive.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   443
	CMSRPMessageHandler *iCurrentMsgHandler;	
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   444
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   445
	// Message queues	
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   446
	CQueueMsgHandlers<CMSRPMessageHandler> iOutMsgQ;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   447
	CQueueMsgHandlers<CMSRPMessageHandler> iInCommingMsgQ;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   448
	CQueueMsgHandlers<CMSRPMessageHandler> iPendingSendMsgQ;
58
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   449
	CQueueMsgHandlers<CMSRPMessageHandler> iPendingForDeletionQ;	
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   450
    CQueueMsgHandlers< CMSRPMessageHandler > iPendingDataSendCompleteQ;    
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   451
    CQueueMsgHandlers< CMSRPMessageHandler > iPendingDataIncCompleteQ;    
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   452
    
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   453
    // progress report queues
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   454
    CQueueMsgHandlers< CMSRPMessageHandler > iPendingSendProgressQ;    
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   455
    CQueueMsgHandlers< CMSRPMessageHandler > iPendingReceiveProgressQ;    
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   456
	
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   457
	// This queue holds the instance of messages currently being received
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   458
    CQueueMsgHandlers< CMSRPMessageHandler > iCurrentlyReceivingMsgQ;    
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   459
	
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   460
	TBool iSendProgressReports;
cdb720e67852 This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents: 25
diff changeset
   461
	
25
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   462
	friend class TStateBase;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   463
	friend class TStateIdle; 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   464
	friend class TStateConnecting; 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   465
	friend class TStateActive;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   466
	friend class TStateWaitForClient; 
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   467
	friend class TStateError; // Not a very good thing !! Need change.
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   468
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   469
	#ifdef __UT_TSTATEFACTORY_H__
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   470
	friend class UT_TStateFactory;
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   471
	#endif
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   472
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   473
    };
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   474
505ad3f0ce5c MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff changeset
   475
#endif /* CMSRPSERVERSUBSESSION_H_ */