author | Petteri Saari <petteri.saari@digia.com> |
Thu, 25 Nov 2010 13:59:42 +0200 | |
branch | MSRP_FrameWork |
changeset 58 | cdb720e67852 |
parent 25 | 505ad3f0ce5c |
child 60 | 7634585a4347 |
permissions | -rw-r--r-- |
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 |
#include "TStates.h" |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
18 |
#include "TStateFactory.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 "CMSRPServerSubSession.h" |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
21 |
#include "CMSRPMessageHandler.h" |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
22 |
#include "CMSRPResponse.h" |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
23 |
#include "MMSRPConnection.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 |
TStateBase* TStateBase::HandleStateErrorL(CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
27 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
28 |
// Error handling for invalid events received in a given state. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
29 |
if(NULL != aContext->iClientMessage) |
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 |
// Complete the client with a error. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
32 |
// Set this to iClientReceivedEventData to NULL. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
33 |
aContext->CompleteClient(KErrNone); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
34 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
35 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
36 |
if(NULL != aContext->iReceivedMsg) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
37 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
38 |
// !! Handle |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
39 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
40 |
return aContext->StateFactory().getStateL(EIdle); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
41 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
42 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
43 |
TStateBase* TStateBase::processIncommingMessageL(CMSRPServerSubSession *aContext, |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
44 |
CMSRPMessageHandler* incommingMsg) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
45 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
46 |
MSRPLOG("TStateBase::processIncommingMessage Entered!"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
47 |
CMSRPMessageHandler *incommingMsgHandler; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
48 |
if(NULL == incommingMsg) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
49 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
50 |
incommingMsgHandler = aContext->iInCommingMsgQ.DeQueue(); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
51 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
52 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
53 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
54 |
incommingMsgHandler = incommingMsg; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
55 |
} |
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 |
if(incommingMsgHandler) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
58 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
59 |
if(MMSRPIncomingMessage::EMSRPResponse == incommingMsgHandler->MessageType()) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
60 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
61 |
return handlesResponseL(aContext,incommingMsgHandler); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
62 |
} |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
63 |
if( MMSRPIncomingMessage::EMSRPReport == incommingMsgHandler->MessageType( ) ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
64 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
65 |
return handleRequestsL( aContext,incommingMsgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
66 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
67 |
else |
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 |
return handleRequestsL(aContext,incommingMsgHandler); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
70 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
71 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
72 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
73 |
return NULL; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
74 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
75 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
76 |
TStateBase* TStateBase::processPendingMessageQL(CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
77 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
78 |
MSRPLOG("TStateBase::processPendingMessagesL Entered!"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
79 |
CMSRPMessageHandler *msgHandler; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
80 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
81 |
msgHandler = aContext->iPendingSendMsgQ.DeQueue(); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
82 |
msgHandler->SendMessageL(*aContext->iConnection); |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
83 |
aContext->iOutMsgQ.Queue( *msgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
84 |
return aContext->StateFactory().getStateL( EActive ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
85 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
86 |
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
87 |
TStateBase* TStateBase::processCompletedMessageL( CMSRPServerSubSession *aContext ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
88 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
89 |
MSRPLOG("TStateBase::processCompletedMessageL Entered!"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
90 |
CMSRPMessageHandler* msgHandler = aContext->iPendingDataSendCompleteQ.DeQueue(); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
91 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
92 |
if ( msgHandler->IsTransmissionTerminated() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
93 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
94 |
MSRPLOG("TStateBase::processCompletedMessageL transmission terminated"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
95 |
if( aContext->iResponseListner.Check() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
96 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
97 |
MSRPLOG("TStateBase::processCompletedMessageL complete with KErrCancel"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
98 |
aContext->iResponseListner.Complete( KErrCancel ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
99 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
100 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
101 |
else |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
102 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
103 |
aContext->sendResultToClientL( msgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
104 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
105 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
106 |
delete msgHandler; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
107 |
return aContext->StateFactory().getStateL( EWaitForClient ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
108 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
109 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
110 |
TStateBase* TStateBase::processCompletedIncomingMessageL( CMSRPServerSubSession *aContext ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
111 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
112 |
MSRPLOG("TStateBase::processCompletedIncomingMessageL Entered!"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
113 |
CMSRPMessageHandler* msgHandler = aContext->iPendingDataIncCompleteQ.DeQueue(); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
114 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
115 |
if ( msgHandler->IsTransmissionTerminated() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
116 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
117 |
MSRPLOG("TStateBase::processCompletedIncomingMessageL transmission terminated"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
118 |
if( aContext->iIncommingMessageListner.Check() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
119 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
120 |
MSRPLOG("TStateBase::processCompletedIncomingMessageL complete with KErrCancel"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
121 |
aContext->iIncommingMessageListner.Complete( KErrCancel ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
122 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
123 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
124 |
else |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
125 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
126 |
aContext->sendMsgToClientL( msgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
127 |
delete msgHandler; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
128 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
129 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
130 |
return aContext->StateFactory().getStateL( EWaitForClient ); |
25
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 |
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
133 |
TStateBase* TStateBase::processReceiveReportL( CMSRPServerSubSession *aContext ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
134 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
135 |
MSRPLOG("TStateBase::processReceiveReportL Entered!"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
136 |
CMSRPMessageHandler* msgHandler = aContext->iPendingReceiveProgressQ.DeQueue(); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
137 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
138 |
aContext->ReceiveProgressToClientL( msgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
139 |
return aContext->StateFactory().getStateL( EWaitForClient ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
140 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
141 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
142 |
TStateBase* TStateBase::processSendReportL( CMSRPServerSubSession *aContext ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
143 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
144 |
MSRPLOG("TStateBase::processSendReportL Entered!"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
145 |
CMSRPMessageHandler* msgHandler = aContext->iPendingSendProgressQ.DeQueue(); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
146 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
147 |
aContext->SendProgressToClientL( msgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
148 |
return aContext->StateFactory().getStateL( EWaitForClient ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
149 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
150 |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
151 |
TStateBase* TStateBase::handlesResponseL(CMSRPServerSubSession *aContext, |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
152 |
CMSRPMessageHandler *incommingMsgHandler) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
153 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
154 |
TStateBase *nextState; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
155 |
MSRPLOG("TStateBase::handlesResponseL Entered!"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
156 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
157 |
// Search the outgoing Queue to find the owner of the owner of this response. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
158 |
CMSRPMessageHandler *outgoingMsgHandler = |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
159 |
aContext->iOutMsgQ.getMatch(incommingMsgHandler); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
160 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
161 |
if(NULL == outgoingMsgHandler) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
162 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
163 |
// No outgoingMsgHandler to match the received response. Stray response. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
164 |
MSRPLOG("TStateBase::handlesResponseL() Received Stray Response!!"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
165 |
MSRPLOG("TStateBase::handlesResponseL() No Outgoing message handler found"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
166 |
nextState = this; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
167 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
168 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
169 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
170 |
CleanupStack::PushL( incommingMsgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
171 |
TUint responseCode = outgoingMsgHandler->ConsumeResponseL( *incommingMsgHandler ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
172 |
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
173 |
if( outgoingMsgHandler->IsMessageComplete() || |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
174 |
responseCode != EAllOk || |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
175 |
( outgoingMsgHandler->IsFailureHeaderPartial() && |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
176 |
responseCode != EAllOk ) ) |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
177 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
178 |
aContext->iConnection->CancelSendingL( outgoingMsgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
179 |
aContext->sendResultToClientL( outgoingMsgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
180 |
aContext->iOutMsgQ.explicitRemove( outgoingMsgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
181 |
delete outgoingMsgHandler; |
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 |
else |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
184 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
185 |
aContext->iConnection->ContinueSendingL( *outgoingMsgHandler ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
186 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
187 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
188 |
CleanupStack::Pop(incommingMsgHandler); |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
189 |
nextState = aContext->StateFactory().getStateL(EWaitForClient); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
190 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
191 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
192 |
delete incommingMsgHandler; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
193 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
194 |
MSRPLOG("TStateBase::handlesResponseL Exit!"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
195 |
return nextState; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
196 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
197 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
198 |
TStateBase* TStateBase::handleRequestsL(CMSRPServerSubSession *aContext, |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
199 |
CMSRPMessageHandler *incommingMsgHandler) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
200 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
201 |
MSRPLOG("-> TStateBase::handleRequestsL"); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
202 |
MMSRPIncomingMessage::TMSRPMessageType msgType = incommingMsgHandler->MessageType(); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
203 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
204 |
if(MMSRPIncomingMessage::EMSRPMessage == msgType) // SEND request |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
205 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
206 |
MSRPLOG("SEND request received"); |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
207 |
incommingMsgHandler->SendResponseL(aContext, *aContext->iConnection, EAllOk ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
208 |
incommingMsgHandler->SendReportL(aContext, *aContext->iConnection, EAllOk ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
209 |
if( incommingMsgHandler->IsMessageComplete() ) |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
210 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
211 |
MSRPLOG("-> TStateBase::handleRequestsL complete"); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
212 |
aContext->sendMsgToClientL(incommingMsgHandler); |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
213 |
delete incommingMsgHandler; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
214 |
//aContext->iPendingForDeletionQ.Queue(*incommingMsgHandler); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
215 |
return aContext->StateFactory().getStateL(EWaitForClient); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
216 |
} |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
217 |
return aContext->StateFactory().getStateL( EActive ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
218 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
219 |
else if(MMSRPIncomingMessage::EMSRPReport == msgType) // Drop Reports |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
220 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
221 |
aContext->sendMsgToClientL( incommingMsgHandler ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
222 |
delete incommingMsgHandler; |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
223 |
//aContext->iPendingForDeletionQ.Queue(*incommingMsgHandler); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
224 |
return aContext->StateFactory().getStateL( EWaitForClient ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
225 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
226 |
else // It is an unrecognized request eg. AUTH |
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 |
MSRPLOG("Unrecognized request received"); |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
229 |
incommingMsgHandler->SendResponseL(aContext, *aContext->iConnection, EUnknownRequestMethod ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
230 |
aContext->iPendingForDeletionQ.Queue(*incommingMsgHandler); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
231 |
return aContext->StateFactory().getStateL(EWaitForClient); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
232 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
233 |
} |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
234 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
235 |
TStateBase* TStateBase::handleClientListnerCancelL( CMSRPServerSubSession* aContext, |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
236 |
TMSRPFSMEvent aEvent) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
237 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
238 |
MSRPLOG("-> TStateBase::handleClientListnerCancelL"); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
239 |
if(aEvent == EMSRPCancelReceivingEvent) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
240 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
241 |
// let's find the correct listener first |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
242 |
TBuf8< KMaxLengthOfTransactionIdString > messageId; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
243 |
aContext->iClientMessage->ReadL( 0, messageId ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
244 |
// going through all incoming instances |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
245 |
CMSRPMessageHandler* owner = aContext->iCurrentlyReceivingMsgQ.FindElement( messageId ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
246 |
if ( owner ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
247 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
248 |
MSRPLOG2("TStateBase::handleClientListnerCancelL terminating %d", owner ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
249 |
owner->TerminateReceiving( aContext, *aContext->iConnection ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
250 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
251 |
else |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
252 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
253 |
if( aContext->iIncommingMessageListner.Check() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
254 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
255 |
aContext->iIncommingMessageListner.Complete( KErrNone ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
256 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
257 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
258 |
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
259 |
// Confirm completion of the Cancel Request. |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
260 |
aContext->CompleteClient( KErrNone ); |
25
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 |
if(aEvent == EMSRPCancelSendRespListeningEvent) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
264 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
265 |
// Confirm completion of the Cancel Request. |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
266 |
aContext->CompleteClient( KErrNone ); |
25
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 |
// Complete the Listner if that is active. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
269 |
if(aContext->iResponseListner.Check()) |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
270 |
aContext->iResponseListner.Complete( KErrNone ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
271 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
272 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
273 |
return aContext->StateFactory().getStateL(EWaitForClient); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
274 |
} |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
275 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
276 |
TStateBase* TStateBase::HandleClientCancelSendingL( CMSRPServerSubSession* aContext ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
277 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
278 |
MSRPLOG("-> TStateBase::HandleClientCancelSendingL"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
279 |
// let's find the correct listener first |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
280 |
TBuf8< KMaxLengthOfTransactionIdString > messageId; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
281 |
aContext->iClientMessage->ReadL( 0, messageId ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
282 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
283 |
// going through all incoming instances |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
284 |
CMSRPMessageHandler* owner = aContext->iOutMsgQ.FindElement( messageId ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
285 |
if ( owner ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
286 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
287 |
MSRPLOG2("TStateBase::HandleClientCancelSendingL terminating %d", owner ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
288 |
owner->TerminateSending( ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
289 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
290 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
291 |
// Confirm completion of the Cancel Request. |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
292 |
aContext->CompleteClient( KErrNone ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
293 |
return this; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
294 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
295 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
296 |
TStateBase* TStateBase::handleConnectionStateChangedL(CMSRPServerSubSession *aContext) |
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 |
TStateBase* state = NULL; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
299 |
TInt iConnectionEvent = aContext->iConnection->getConnectionState(); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
300 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
301 |
MSRPLOG2("handleConnectionStateChanged::Connection Event %d \n",iConnectionEvent ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
302 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
303 |
switch(iConnectionEvent) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
304 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
305 |
case -1: // Error Scenario |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
306 |
state = handleConnectionErrorsL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
307 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
308 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
309 |
case 1: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
310 |
case 2: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
311 |
MSRPLOG("handleConnectionStateChanged::Connection in Progress \n"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
312 |
state = this; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
313 |
break; |
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 |
case 3: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
316 |
// Connected. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
317 |
MSRPLOG("handleConnectionStateChanged: Connected now." ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
318 |
aContext->informConnectionReadyToClient(); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
319 |
state = aContext->StateFactory().getStateL(EWaitForClient); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
320 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
321 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
322 |
case 4: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
323 |
case 5: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
324 |
MSRPLOG("handleConnectionStateChanged: TimeOut now." ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
325 |
if(EDownstream == aContext->iConnDirection) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
326 |
aContext->iConnectionListner.Complete(-33); // TODO : Change to query the exact erorr code from the connection. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
327 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
328 |
aContext->iIncommingMessageListner.Complete(-33); // TODO : Change to query the exact erorr code from the connection. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
329 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
330 |
state = aContext->StateFactory().getStateL(EWaitForClient); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
331 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
332 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
333 |
case 0: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
334 |
// Not Connected. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
335 |
MSRPLOG("handleConnectionStateChanged: TimeOut now." ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
336 |
state = this; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
337 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
338 |
} |
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 |
return state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
341 |
} |
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 |
TStateBase* TStateBase::handleConnectionErrorsL(CMSRPServerSubSession *aContext) |
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 |
TStateBase* state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
346 |
if(TRUE == aContext->iConnectionListner.Check()) |
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 |
// Have a connection listner to inform connection errors. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
349 |
// This scenario happens where there is a connection error during "Connect" |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
350 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
351 |
aContext->iConnectionListner.Complete(KErrCouldNotConnect); // TODO : Change to query the exact erorr code from the connection. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
352 |
aContext->iConnection->ReleaseConnection(*aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
353 |
aContext->iConnection = NULL; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
354 |
state = aContext->StateFactory().getStateL(EWaitForClient); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
355 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
356 |
else |
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 |
// If do not have a connection listner. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
359 |
// This is a case where a established connection(connect/listen) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
360 |
// is now reporting a Error. |
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 |
// ConnectionErrors in the current scheme of things will be reported via |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
363 |
// iIncommingMessageListner. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
364 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
365 |
if(!aContext->iIncommingMessageListner.Check()) |
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 |
// Case where the subsession is waiting for the Client subsessions |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
368 |
// to provide it with listner to reports issues on. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
369 |
// Just move to the EIdle state. EIdle is the not connected state. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
370 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
371 |
// The connection error here will be reported from the TIdle state. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
372 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
373 |
state = aContext->StateFactory().getStateL(EIdle); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
374 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
375 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
376 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
377 |
aContext->iIncommingMessageListner.Complete(KErrDisconnected); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
378 |
aContext->iConnection->ReleaseConnection(*aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
379 |
aContext->iConnection = NULL; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
380 |
state = aContext->StateFactory().getStateL(EIdle); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
381 |
} |
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 |
return state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
384 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
385 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
386 |
TStateBase* TStateBase::handleQueuesL(CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
387 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
388 |
TStateBase * state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
389 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
390 |
if( aContext->QueuesEmpty() ) |
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 |
state = aContext->StateFactory().getStateL( EActive ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
393 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
394 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
395 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
396 |
CMSRPServerSubSession::TQueueType type = aContext->getQToProcess(); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
397 |
if ( type == CMSRPServerSubSession::TReceiveProgressQueue ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
398 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
399 |
state = processReceiveReportL( aContext ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
400 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
401 |
else if ( type == CMSRPServerSubSession::TSendProgressQueue ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
402 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
403 |
state = processSendReportL( aContext ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
404 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
405 |
else if ( type == CMSRPServerSubSession::TCompletedSendQueue ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
406 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
407 |
state = processCompletedMessageL( aContext ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
408 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
409 |
else if ( type == CMSRPServerSubSession::TCompletedIncQueue ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
410 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
411 |
state = processCompletedIncomingMessageL( aContext ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
412 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
413 |
else if( type == CMSRPServerSubSession::TInCommingMsgQueue ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
414 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
415 |
state = processIncommingMessageL( aContext ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
416 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
417 |
else |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
418 |
{ |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
419 |
state = processPendingMessageQL( aContext ); |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
420 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
421 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
422 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
423 |
return state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
424 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
425 |
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
426 |
TStateBase* TStateBase::handleInCommingMessagesL(CMSRPServerSubSession *aContext) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
427 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
428 |
CMSRPMessageHandler* incommingMsg = aContext->iReceivedMsg; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
429 |
aContext->iReceivedMsg = NULL; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
430 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
431 |
return processIncommingMessageL(aContext, incommingMsg); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
432 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
433 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
434 |
TStateBase* TStateBase::MessageSendCompleteL(CMSRPServerSubSession *aContext) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
435 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
436 |
// Handle send message complete event. |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
437 |
if( NULL == aContext->iCurrentMsgHandler) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
438 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
439 |
MSRPLOG( "TStateBase::MessageSendCompleteL :: iCurrentMsgHandler is NULL \n" ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
440 |
return this; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
441 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
442 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
443 |
if ( aContext->iCurrentMsgHandler->IsTransmissionTerminated() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
444 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
445 |
MSRPLOG("TStateBase::processCompletedMessageL transmission terminated"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
446 |
if( aContext->iResponseListner.Check() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
447 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
448 |
MSRPLOG("TStateBase::processCompletedMessageL complete with KErrCancel"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
449 |
aContext->iResponseListner.Complete( KErrCancel ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
450 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
451 |
return aContext->StateFactory().getStateL( EWaitForClient ); |
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 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
454 |
if( aContext->iCurrentMsgHandler->IsMessageComplete() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
455 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
456 |
// Messages with Failure Report set to "No" will never get a response. |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
457 |
aContext->sendResultToClientL( aContext->iCurrentMsgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
458 |
CMSRPMessageHandler* temp = aContext->iOutMsgQ.getMatch( aContext->iCurrentMsgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
459 |
if ( temp ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
460 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
461 |
aContext->iOutMsgQ.explicitRemove( aContext->iCurrentMsgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
462 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
463 |
delete aContext->iCurrentMsgHandler; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
464 |
aContext->iCurrentMsgHandler = NULL; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
465 |
return aContext->StateFactory().getStateL( EWaitForClient ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
466 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
467 |
else |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
468 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
469 |
aContext->iCurrentMsgHandler = NULL; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
470 |
// Handle any pending events in Queue. |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
471 |
return handleQueuesL(aContext); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
472 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
473 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
474 |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
475 |
TStates TStateIdle::identity() |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
476 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
477 |
return EIdle; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
478 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
479 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
480 |
TStateBase* TStateIdle::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
481 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
482 |
// TStateIdle is a state where the subsession is waiting to get connected. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
483 |
// It is the first state which is entered post sub-session creation. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
484 |
// Also it is the state that is entered in case there is of a connection error. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
485 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
486 |
// It may be possible that the client could not be informed about the |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
487 |
// connection error. Thus any client listner setup events will inform the client about |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
488 |
// the current disconnected state. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
489 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
490 |
// Any existing queues of received messages, received client send requests would be |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
491 |
// retained as it is. Any events for send messages received from the client |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
492 |
// would be queued up. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
493 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
494 |
// An event from the connection layer is considered invalid as the connection is |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
495 |
// assumed to be dead. Such events will result in a error report being published. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
496 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
497 |
MSRPLOG2("Entered TStateIdle Event %d",aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
498 |
TStateBase* state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
499 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
500 |
switch(aEvent) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
501 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
502 |
case ELocalMSRPPathEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
503 |
state = handleLocalMSRPPathRequestL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
504 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
505 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
506 |
case EMSRPConnectEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
507 |
aContext->iConnDirection = EDownstream; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
508 |
state = handleConnectRequestL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
509 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
510 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
511 |
case EMSRPListenEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
512 |
aContext->iConnDirection = EUpstream; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
513 |
state = handleListenRequestL( aContext ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
514 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
515 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
516 |
case EMSRPListenMessagesEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
517 |
case EMSRPListenSendResultEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
518 |
// A MSRP Connection error code would be more appropriate here. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
519 |
aContext->CompleteClient(KErrCouldNotConnect); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
520 |
state = this; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
521 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
522 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
523 |
case EMSRPCancelReceivingEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
524 |
case EMSRPCancelSendRespListeningEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
525 |
state = handleClientListnerCancelL(aContext, aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
526 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
527 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
528 |
case EConnectionStateChangedEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
529 |
state = handleConnectionStateChangedL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
530 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
531 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
532 |
default: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
533 |
// Any such error usually a client/server protocol voilation. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
534 |
// A bug to fix. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
535 |
MSRPLOG2("TStateIdle::EventL :: Err!! Invalid state to have received %d",aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
536 |
state = HandleStateErrorL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
537 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
538 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
539 |
return state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
540 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
541 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
542 |
TStateBase* TStateIdle::handleLocalMSRPPathRequestL( CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
543 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
544 |
// The function is reponsible for contructing a Local MSRP path and returning it to the |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
545 |
// client. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
546 |
// path:msrp://atlanta.example.com:7654/jshA7weztas;tcp |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
547 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
548 |
// !! The current implementation should change to fully construct a MSRP path in the |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
549 |
// subsessoin and send back the result as path buffer. Right now this done in the client. !! |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
550 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
551 |
MSRPLOG("TStateIdle::HandleLocalPathRequestL()"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
552 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
553 |
TInetAddr localAddr; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
554 |
aContext->ConnectionManager().ResolveLocalIPAddressL( localAddr ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
555 |
localAddr.Output(aContext->iLocalHost); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
556 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
557 |
aContext->iLocalPathMSRPDataPckg().iLocalHost.Copy( aContext->iLocalHost ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
558 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
559 |
TInt reason = aContext->Write(0, aContext->iLocalPathMSRPDataPckg); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
560 |
aContext->CompleteClient(KErrNone); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
561 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
562 |
return this; // No state change. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
563 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
564 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
565 |
TStateBase* TStateIdle::handleConnectRequestL(CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
566 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
567 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
568 |
if(!aContext->iConnectionListner.set(*(aContext->iClientMessage))) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
569 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
570 |
MSRPLOG("TStateIdle::handleConnectRequestL() iConnectionListner is already setup"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
571 |
MSRPLOG("TStateIdle::handleConnectRequestL() Invalid state to setup for ConnectionListner"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
572 |
return HandleStateErrorL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
573 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
574 |
aContext->iClientMessage = NULL; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
575 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
576 |
aContext->iConnectionListner.ReadL( 0, aContext->iConnectMSRPdataPckg ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
577 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
578 |
aContext->iRemoteHost = aContext->iConnectMSRPdataPckg().iRemoteHost; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
579 |
aContext->iRemotePort = aContext->iConnectMSRPdataPckg().iRemotePort; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
580 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
581 |
aContext->iRemoteSessionID = |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
582 |
HBufC8::NewL( aContext->iConnectMSRPdataPckg().iRemoteSessionID.Length()); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
583 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
584 |
*(aContext->iRemoteSessionID) = |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
585 |
aContext->iConnectMSRPdataPckg().iRemoteSessionID; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
586 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
587 |
// Request for a Connection. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
588 |
MMSRPConnection &connection = |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
589 |
aContext->ConnectionManager().getConnectionL( |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
590 |
aContext->iRemoteHost |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
591 |
,aContext->iRemotePort); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
592 |
aContext->iConnection = &connection; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
593 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
594 |
TBool connReady = initializeConnectionL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
595 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
596 |
if(!connReady) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
597 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
598 |
MSRPLOG("TStateIdle:: Transtion to State EConnecting" ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
599 |
return aContext->StateFactory().getStateL(EConnecting); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
600 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
601 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
602 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
603 |
MSRPLOG("TStateIdle:: Transtion to State EConnecting" ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
604 |
aContext->informConnectionReadyToClient(); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
605 |
return aContext->StateFactory().getStateL(EWaitForClient); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
606 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
607 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
608 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
609 |
TStateBase* TStateIdle::handleListenRequestL(CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
610 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
611 |
if(!aContext->iIncommingMessageListner.set(*(aContext->iClientMessage))) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
612 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
613 |
MSRPLOG("TStateWaitForClient::EventL iIncomming listner is already setup"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
614 |
MSRPLOG("TStateWaitForClient::EventL Invalid state to setup a listner"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
615 |
return HandleStateErrorL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
616 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
617 |
aContext->iClientMessage = NULL; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
618 |
aContext->iIncommingMessageListner.ReadL( 0, aContext->iListenMSRPdataPckg ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
619 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
620 |
aContext->iRemoteHost = aContext->iListenMSRPdataPckg().iRemoteHost; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
621 |
aContext->iRemotePort = aContext->iListenMSRPdataPckg().iRemotePort; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
622 |
aContext->iRemoteSessionID = |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
623 |
HBufC8::NewL( aContext->iListenMSRPdataPckg().iRemoteSessionID.Length()); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
624 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
625 |
*(aContext->iRemoteSessionID) = |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
626 |
aContext->iListenMSRPdataPckg().iRemoteSessionID; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
627 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
628 |
// Request for a Connection. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
629 |
MMSRPConnection &connection = |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
630 |
aContext->ConnectionManager().getConnectionL( |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
631 |
aContext->iRemoteHost |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
632 |
,aContext->iRemotePort); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
633 |
aContext->iConnection = &connection; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
634 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
635 |
TBool connReady = initializeConnectionL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
636 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
637 |
if(!connReady) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
638 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
639 |
MSRPLOG("TStateIdle:: Transtion to State EConnecting" ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
640 |
return aContext->StateFactory().getStateL(EConnecting); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
641 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
642 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
643 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
644 |
MSRPLOG("TStateIdle:: Transtion to State EConnecting" ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
645 |
aContext->informConnectionReadyToClient(); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
646 |
return aContext->StateFactory().getStateL(EWaitForClient); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
647 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
648 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
649 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
650 |
TBool TStateIdle::initializeConnectionL(CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
651 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
652 |
// Connect or Listen on Connection. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
653 |
// Return status based on connection is ready for use or not. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
654 |
TBool retVal = FALSE; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
655 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
656 |
if(EDownstream == aContext->iConnDirection) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
657 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
658 |
if(3 == aContext->iConnection->ConnectL(*aContext)) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
659 |
retVal = TRUE; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
660 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
661 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
662 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
663 |
if(3 == aContext->iConnection->ListenL(*aContext)) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
664 |
retVal = TRUE; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
665 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
666 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
667 |
return retVal; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
668 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
669 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
670 |
TStates TStateConnecting::identity() |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
671 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
672 |
return EConnecting; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
673 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
674 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
675 |
TStateBase* TStateConnecting::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
676 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
677 |
MSRPLOG2("Entered TStateConnecting Event %d",aEvent); |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
678 |
TStateBase *state = this; |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
679 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
680 |
switch(aEvent) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
681 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
682 |
case EMSRPProcessQueuedRequestsEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
683 |
aContext->CompleteClient(KErrNone); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
684 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
685 |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
686 |
case EConnectionStateChangedEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
687 |
state = handleConnectionStateChangedL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
688 |
break; |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
689 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
690 |
case EMSRPDataSendMessageEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
691 |
aContext->QueueClientSendRequestsL(); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
692 |
break; |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
693 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
694 |
default: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
695 |
MSRPLOG2("TStateConnecting::EventL :: Err!! Invalid state to have received %d", |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
696 |
aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
697 |
state = HandleStateErrorL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
698 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
699 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
700 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
701 |
return state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
702 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
703 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
704 |
TStates TStateWaitForClient::identity() |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
705 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
706 |
return EWaitForClient; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
707 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
708 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
709 |
TStateBase* TStateWaitForClient::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
710 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
711 |
// In the TStateWaitForClient stat the server subsession waits for the client to setup |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
712 |
// handlers to receive requests/responses/reports from the MSRP peer. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
713 |
// TODO - TStateWaitForClient can be removed. Replace this with a eventQueue implementation. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
714 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
715 |
MSRPLOG2("Entered TStateWaitForClient Event %d",aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
716 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
717 |
TStateBase *state = NULL; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
718 |
switch(aEvent) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
719 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
720 |
case EMSRPProcessQueuedRequestsEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
721 |
aContext->CompleteClient(KErrNone); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
722 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
723 |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
724 |
case EMSRPListenMessagesEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
725 |
if(!aContext->iIncommingMessageListner.set(*(aContext->iClientMessage))) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
726 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
727 |
MSRPLOG("TStateWaitForClient::EventL iIncomming listner is already setup"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
728 |
MSRPLOG2("TStateWaitForClient::EventL Invalid state to have received %d", aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
729 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
730 |
aContext->iClientMessage = NULL; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
731 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
732 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
733 |
case EMSRPListenSendResultEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
734 |
if(!aContext->iResponseListner.set(*(aContext->iClientMessage))) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
735 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
736 |
MSRPLOG("TStateWaitForClient::EventL SendResult Listner is already setup"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
737 |
MSRPLOG2("TStateWaitForClient::EventL Invalid state to have received %d", aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
738 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
739 |
aContext->iClientMessage = NULL; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
740 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
741 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
742 |
case EMSRPIncomingMessageReceivedEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
743 |
// Queue any thing that comes. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
744 |
aContext->iInCommingMsgQ.Queue(*aContext->iReceivedMsg); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
745 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
746 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
747 |
case EMSRPDataSendCompleteEvent: |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
748 |
case EMSRPDataCancelledEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
749 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
750 |
MSRPLOG("TStateWaitForClient::EventL EMSRPDataCancelledEvent"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
751 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
752 |
if( aContext->iCurrentMsgHandler->IsMessageComplete() ) |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
753 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
754 |
MSRPLOG("TStateWaitForClient::EventL moving to pending data"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
755 |
aContext->iOutMsgQ.explicitRemove( aContext->iCurrentMsgHandler ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
756 |
aContext->iPendingDataSendCompleteQ.Queue( *aContext->iCurrentMsgHandler ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
757 |
} |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
758 |
aContext->iCurrentMsgHandler = NULL; |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
759 |
break; |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
760 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
761 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
762 |
case EMSRPResponseSendCompleteEvent: |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
763 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
764 |
if( aContext->iReceivedResp->IsMessageComplete() ) |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
765 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
766 |
aContext->iPendingDataIncCompleteQ.Queue( *aContext->iReceivedResp ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
767 |
} |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
768 |
aContext->iReceivedResp = NULL; |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
769 |
break; |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
770 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
771 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
772 |
case EMSRPReportSendCompleteEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
773 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
774 |
if( aContext->iReceivedReport->IsMessageComplete() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
775 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
776 |
aContext->iPendingDataIncCompleteQ.Queue( *aContext->iReceivedReport ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
777 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
778 |
aContext->iReceivedReport = NULL; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
779 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
780 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
781 |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
782 |
case EMSRPDataSendMessageEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
783 |
aContext->QueueClientSendRequestsL(); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
784 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
785 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
786 |
case EMSRPCancelReceivingEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
787 |
case EMSRPCancelSendRespListeningEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
788 |
handleClientListnerCancelL(aContext, aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
789 |
break; |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
790 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
791 |
case EMSRPDataSendMessageCancelEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
792 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
793 |
HandleClientCancelSendingL( aContext ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
794 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
795 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
796 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
797 |
case EConnectionStateChangedEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
798 |
state = handleConnectionStateChangedL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
799 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
800 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
801 |
case EMSRPSendProgressEvent: |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
802 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
803 |
state = aContext->StateFactory().getStateL( EWaitForClient ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
804 |
// queue only if this msghandler is not already in the queue |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
805 |
if ( aContext->iPendingSendProgressQ.FindElement( aContext->iSendProgressMsg ) == NULL ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
806 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
807 |
aContext->iPendingSendProgressQ.Queue( *aContext->iSendProgressMsg ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
808 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
809 |
break; |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
810 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
811 |
case EMSRPReceiveProgressEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
812 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
813 |
// Queue any thing that comes. |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
814 |
state = aContext->StateFactory().getStateL( EWaitForClient ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
815 |
// queue only if this msghandler is not already in the queue |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
816 |
if ( aContext->iPendingReceiveProgressQ.FindElement( aContext->iReceiveProgressMsg ) == NULL ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
817 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
818 |
aContext->iPendingReceiveProgressQ.Queue( *aContext->iReceiveProgressMsg ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
819 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
820 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
821 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
822 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
823 |
default: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
824 |
// Any such error usually a client/server protocol voilation or connection/subsession |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
825 |
// protocol voilation. A bug to fix!! |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
826 |
MSRPLOG2("TStateWaitForClient::EventL :: Err!! Invalid state was received %d",aEvent); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
827 |
state = HandleStateErrorL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
828 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
829 |
}; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
830 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
831 |
if(NULL == state) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
832 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
833 |
// State not set. |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
834 |
if( !aContext->listnerSetupComplete() ) |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
835 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
836 |
state = this; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
837 |
} |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
838 |
else |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
839 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
840 |
state = handleQueuesL(aContext); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
841 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
842 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
843 |
return state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
844 |
} |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
845 |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
846 |
TStates TStateActive::identity() |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
847 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
848 |
return EActive; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
849 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
850 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
851 |
TStateBase* TStateActive::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
852 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
853 |
// TStateActive is entered when the subsession is in a connected state and client setup |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
854 |
// is done. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
855 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
856 |
MSRPLOG2("Entered TStateActive Event %d",aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
857 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
858 |
TStateBase *state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
859 |
switch(aEvent) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
860 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
861 |
case EMSRPDataSendMessageEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
862 |
state = handleSendDataL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
863 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
864 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
865 |
case EMSRPIncomingMessageReceivedEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
866 |
state = handleInCommingMessagesL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
867 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
868 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
869 |
case EConnectionStateChangedEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
870 |
state = handleConnectionStateChangedL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
871 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
872 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
873 |
case EMSRPCancelReceivingEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
874 |
case EMSRPCancelSendRespListeningEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
875 |
state = handleClientListnerCancelL(aContext, aEvent); |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
876 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
877 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
878 |
case EMSRPDataSendMessageCancelEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
879 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
880 |
state = HandleClientCancelSendingL( aContext ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
881 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
882 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
883 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
884 |
case EMSRPDataCancelledEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
885 |
case EMSRPDataSendCompleteEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
886 |
state = MessageSendCompleteL(aContext); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
887 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
888 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
889 |
case EMSRPResponseSendCompleteEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
890 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
891 |
state = handleResponseSentL(aContext); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
892 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
893 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
894 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
895 |
case EMSRPReportSendCompleteEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
896 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
897 |
state = handleReportSentL( aContext ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
898 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
899 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
900 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
901 |
case EMSRPReceiveProgressEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
902 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
903 |
aContext->ReceiveProgressToClientL( aContext->iReceiveProgressMsg ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
904 |
state = aContext->StateFactory().getStateL( EWaitForClient ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
905 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
906 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
907 |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
908 |
case EMSRPSendProgressEvent: |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
909 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
910 |
aContext->SendProgressToClientL( aContext->iSendProgressMsg ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
911 |
state = aContext->StateFactory().getStateL( EWaitForClient ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
912 |
break; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
913 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
914 |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
915 |
default: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
916 |
// Any such error usually a client/server protocol voilation or connection/subsession |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
917 |
// protocol voilation. A bug to fix!! |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
918 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
919 |
MSRPLOG2("TStateActive::EventL :: Err!! Invalid state to have received %d",aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
920 |
state = HandleStateErrorL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
921 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
922 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
923 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
924 |
return state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
925 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
926 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
927 |
TStateBase* TStateActive::handleSendDataL(CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
928 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
929 |
MSRPLOG("TStateActive::handleSendDataL()"); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
930 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
931 |
aContext->ReadSendDataPckgL(); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
932 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
933 |
CMSRPMessageHandler *msgHandler |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
934 |
= CMSRPMessageHandler::NewL(aContext, |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
935 |
aContext->iSendMSRPdataPckg().iExtMessageBuffer); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
936 |
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
937 |
msgHandler->SendMessageL( *aContext->iConnection ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
938 |
aContext->iOutMsgQ.Queue( *msgHandler ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
939 |
aContext->CompleteClient( KErrNone ); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
940 |
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
941 |
return aContext->StateFactory().getStateL( EActive ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
942 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
943 |
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
944 |
TStateBase* TStateActive::handleResponseSentL( CMSRPServerSubSession* aContext ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
945 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
946 |
MSRPLOG("-> TStateActive::handleResponseSentL"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
947 |
if( aContext->iReceivedResp->IsMessageComplete() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
948 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
949 |
if ( !aContext->iReceivedResp->SendReportL(aContext, *aContext->iConnection, EAllOk ) ) |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
950 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
951 |
if ( aContext->iReceivedResp->IsTransmissionTerminated() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
952 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
953 |
if( aContext->iIncommingMessageListner.Check() ) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
954 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
955 |
aContext->iIncommingMessageListner.Complete( KErrCancel ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
956 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
957 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
958 |
else |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
959 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
960 |
aContext->sendMsgToClientL( aContext->iReceivedResp ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
961 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
962 |
return aContext->StateFactory().getStateL(EWaitForClient); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
963 |
} |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
964 |
else |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
965 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
966 |
aContext->iReceivedResp = NULL; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
967 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
968 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
969 |
else |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
970 |
{ |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
971 |
aContext->iReceivedResp->ResponseHandled(); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
972 |
aContext->iReceivedResp = NULL; |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
973 |
} |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
974 |
MSRPLOG("<- TStateBase::handleRequestsL"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
975 |
return aContext->StateFactory().getStateL( EActive ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
976 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
977 |
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
978 |
TStateBase* TStateActive::handleReportSentL( CMSRPServerSubSession* aContext) |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
979 |
{ |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
980 |
MSRPLOG("-> TStateActive::handleReportSentL"); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
981 |
aContext->sendReportToClientL( aContext->iReceivedReport ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
982 |
aContext->iPendingDataIncCompleteQ.Queue( *aContext->iReceivedReport ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
983 |
aContext->iReceivedReport = NULL; |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
984 |
return aContext->StateFactory().getStateL( EWaitForClient ); |
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
985 |
} |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
986 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
987 |
TStates TStateError::identity() |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
988 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
989 |
return EError; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
990 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
991 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
992 |
TStateBase* TStateError::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
993 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
994 |
// Error State is entered when we receive an Error Response from the opposite |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
995 |
// end point to which we sent a SEND request. When this state is entered the client |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
996 |
// is expected to close the session without trying to send further messages. |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
997 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
998 |
MSRPLOG2("Entered TStateError Event %d", aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
999 |
TStateBase *state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1000 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1001 |
switch(aEvent) |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1002 |
{ |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1003 |
case EMSRPListenMessagesEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1004 |
aContext->CompleteClient(KErrCouldNotConnect); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1005 |
state = this; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1006 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1007 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1008 |
case EMSRPListenSendResultEvent: |
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
1009 |
aContext->CompleteClient( KErrGeneral ); |
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1010 |
state = this; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1011 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1012 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1013 |
case EMSRPDataSendMessageEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1014 |
aContext->CompleteClient(KErrNone); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1015 |
state = this; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1016 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1017 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1018 |
case EMSRPCancelReceivingEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1019 |
case EMSRPCancelSendRespListeningEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1020 |
state = handleClientListnerCancelL(aContext, aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1021 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1022 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1023 |
case EMSRPIncomingMessageReceivedEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1024 |
aContext->iInCommingMsgQ.Queue(*aContext->iReceivedMsg); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1025 |
state = this; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1026 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1027 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1028 |
case EConnectionStateChangedEvent: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1029 |
state = handleConnectionStateChangedL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1030 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1031 |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1032 |
default: |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1033 |
MSRPLOG2("TStateError::EventL :: Err!! Invalid state to have received %d",aEvent); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1034 |
state = HandleStateErrorL(aContext); |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1035 |
break; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1036 |
} |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1037 |
return state; |
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1038 |
} |