|
1 /* |
|
2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html." |
|
8 * Initial Contributors: |
|
9 * Nokia Corporation - initial contribution. |
|
10 * Contributors: |
|
11 * |
|
12 * Description: |
|
13 * MSRP Implementation |
|
14 * |
|
15 */ |
|
16 |
|
17 #include "TStates.h" |
|
18 #include "TStateFactory.h" |
|
19 |
|
20 #include "CMSRPServerSubSession.h" |
|
21 #include "CMSRPMessageHandler.h" |
|
22 #include "CMSRPResponse.h" |
|
23 #include "MMSRPConnection.h" |
|
24 |
|
25 |
|
26 TStateBase* TStateBase::HandleStateErrorL(CMSRPServerSubSession *aContext) |
|
27 { |
|
28 // Error handling for invalid events received in a given state. |
|
29 if(NULL != aContext->iClientMessage) |
|
30 { |
|
31 // Complete the client with a error. |
|
32 // Set this to iClientReceivedEventData to NULL. |
|
33 aContext->CompleteClient(KErrNone); |
|
34 } |
|
35 |
|
36 if(NULL != aContext->iReceivedMsg) |
|
37 { |
|
38 // !! Handle |
|
39 } |
|
40 return aContext->StateFactory().getStateL(EIdle); |
|
41 } |
|
42 |
|
43 TStateBase * TStateFileShare::processIncommingMessageL(CMSRPServerSubSession *aContext, |
|
44 CMSRPMessageHandler* incommingMsg) |
|
45 { |
|
46 MSRPLOG("TStateFileShare::processIncommingMessage Enter!"); |
|
47 TStateBase *state = this; |
|
48 CMSRPMessageHandler *incommingMsgHandler; |
|
49 if(NULL != incommingMsg) |
|
50 { |
|
51 aContext->iInCommingMsgQ.Queue(*incommingMsg); |
|
52 } |
|
53 incommingMsgHandler = aContext->iInCommingMsgQ.DeQueue(); |
|
54 |
|
55 while (incommingMsgHandler && state == this) |
|
56 { |
|
57 if(MMSRPIncomingMessage::EMSRPResponse == incommingMsgHandler->MessageType()) |
|
58 { |
|
59 state = handlesResponseL(aContext,incommingMsgHandler); |
|
60 } |
|
61 else |
|
62 { |
|
63 state = handleRequestsL(aContext,incommingMsgHandler); |
|
64 } |
|
65 incommingMsgHandler = aContext->iInCommingMsgQ.DeQueue(); |
|
66 } |
|
67 |
|
68 MSRPLOG("TStateFileShare::processIncommingMessage Exit!"); |
|
69 return state; |
|
70 } |
|
71 |
|
72 TStateBase* TStateBase::processIncommingMessageL(CMSRPServerSubSession *aContext, |
|
73 CMSRPMessageHandler* incommingMsg) |
|
74 { |
|
75 MSRPLOG("TStateBase::processIncommingMessage Entered!"); |
|
76 CMSRPMessageHandler *incommingMsgHandler; |
|
77 if(NULL == incommingMsg) |
|
78 { |
|
79 incommingMsgHandler = aContext->iInCommingMsgQ.DeQueue(); |
|
80 } |
|
81 else |
|
82 { |
|
83 incommingMsgHandler = incommingMsg; |
|
84 } |
|
85 |
|
86 if(incommingMsgHandler) |
|
87 { |
|
88 if(MMSRPIncomingMessage::EMSRPResponse == incommingMsgHandler->MessageType()) |
|
89 { |
|
90 return handlesResponseL(aContext,incommingMsgHandler); |
|
91 } |
|
92 else |
|
93 { |
|
94 return handleRequestsL(aContext,incommingMsgHandler); |
|
95 } |
|
96 } |
|
97 else |
|
98 return NULL; |
|
99 } |
|
100 |
|
101 TStateBase* TStateBase::processPendingMessageQL(CMSRPServerSubSession *aContext) |
|
102 { |
|
103 MSRPLOG("TStateBase::processPendingMessagesL Entered!"); |
|
104 CMSRPMessageHandler *msgHandler; |
|
105 |
|
106 msgHandler = aContext->iPendingSendMsgQ.DeQueue(); |
|
107 msgHandler->SendMessageL(*aContext->iConnection); |
|
108 |
|
109 // Shift this to Outgoing Queue. |
|
110 aContext->iCurrentMsgHandler = msgHandler; |
|
111 return aContext->StateFactory().getStateL(EActiveSend); |
|
112 } |
|
113 |
|
114 TStateBase* TStateBase::handlesResponseL(CMSRPServerSubSession *aContext, |
|
115 CMSRPMessageHandler *incommingMsgHandler) |
|
116 { |
|
117 TStateBase *nextState; |
|
118 MSRPLOG("TStateBase::handlesResponseL Entered!"); |
|
119 |
|
120 // Search the outgoing Queue to find the owner of the owner of this response. |
|
121 CMSRPMessageHandler *outgoingMsgHandler = |
|
122 aContext->iOutMsgQ.getMatch(incommingMsgHandler); |
|
123 |
|
124 if(NULL == outgoingMsgHandler) |
|
125 { |
|
126 // No outgoingMsgHandler to match the received response. Stray response. |
|
127 MSRPLOG("TStateBase::handlesResponseL() Received Stray Response!!"); |
|
128 MSRPLOG("TStateBase::handlesResponseL() No Outgoing message handler found"); |
|
129 nextState = this; |
|
130 } |
|
131 else |
|
132 { |
|
133 TBool error = 0; |
|
134 CleanupStack::PushL(incommingMsgHandler); |
|
135 TBool sendResult = outgoingMsgHandler->ConsumeResponseL(*incommingMsgHandler); |
|
136 |
|
137 if( sendResult ) |
|
138 { |
|
139 error = aContext->sendResultToClientL(outgoingMsgHandler); |
|
140 } |
|
141 |
|
142 if(outgoingMsgHandler->IsMessageComplete()) |
|
143 { |
|
144 aContext->iOutMsgQ.explicitRemove(outgoingMsgHandler); |
|
145 delete outgoingMsgHandler; |
|
146 } |
|
147 |
|
148 CleanupStack::Pop(incommingMsgHandler); |
|
149 if( error ) |
|
150 { |
|
151 nextState = aContext->StateFactory().getStateL(EError); |
|
152 } |
|
153 else |
|
154 { |
|
155 nextState = aContext->StateFactory().getStateL(EWaitForClient); |
|
156 } |
|
157 } |
|
158 |
|
159 delete incommingMsgHandler; |
|
160 |
|
161 MSRPLOG("TStateBase::handlesResponseL Exit!"); |
|
162 return nextState; |
|
163 } |
|
164 |
|
165 TStateBase* TStateBase::handleRequestsL(CMSRPServerSubSession *aContext, |
|
166 CMSRPMessageHandler *incommingMsgHandler) |
|
167 { |
|
168 MMSRPIncomingMessage::TMSRPMessageType msgType = incommingMsgHandler->MessageType(); |
|
169 |
|
170 if(MMSRPIncomingMessage::EMSRPMessage == msgType) // SEND request |
|
171 { |
|
172 MSRPLOG("SEND request received"); |
|
173 TBool sendToClient = incommingMsgHandler->SendResponseL(aContext, |
|
174 *aContext->iConnection, 0); |
|
175 if(sendToClient) |
|
176 { |
|
177 aContext->sendMsgToClientL(incommingMsgHandler); |
|
178 } |
|
179 aContext->iPendingForDeletionQ.Queue(*incommingMsgHandler); |
|
180 return aContext->StateFactory().getStateL(EWaitForClient); |
|
181 } |
|
182 else if(MMSRPIncomingMessage::EMSRPReport == msgType) // Drop Reports |
|
183 { |
|
184 MSRPLOG("Reports not supported!!"); |
|
185 delete incommingMsgHandler; |
|
186 return this; |
|
187 } |
|
188 else // It is an unrecognized request eg. AUTH |
|
189 { |
|
190 MSRPLOG("Unrecognized request received"); |
|
191 TBool sendToClient = incommingMsgHandler->SendResponseL(aContext, |
|
192 *aContext->iConnection, CMSRPResponse::EUnknownRequestMethod); |
|
193 aContext->iPendingForDeletionQ.Queue(*incommingMsgHandler); |
|
194 return aContext->StateFactory().getStateL(EWaitForClient); |
|
195 } |
|
196 } |
|
197 |
|
198 TStateBase* TStateBase::handleClientListnerCancelL(CMSRPServerSubSession * aContext, |
|
199 TMSRPFSMEvent aEvent) |
|
200 { |
|
201 if(aEvent == EMSRPCancelReceivingEvent) |
|
202 { |
|
203 // Confirm completion of the Cancel Request. |
|
204 aContext->CompleteClient(KErrNone); |
|
205 |
|
206 // Complete the Listner if that is active. |
|
207 if(aContext->iIncommingMessageListner.Check()) |
|
208 aContext->iIncommingMessageListner.Complete(KErrNone); |
|
209 } |
|
210 |
|
211 if(aEvent == EMSRPCancelSendRespListeningEvent) |
|
212 { |
|
213 // Confirm completion of the Cancel Request. |
|
214 aContext->CompleteClient(KErrNone); |
|
215 |
|
216 // Complete the Listner if that is active. |
|
217 if(aContext->iResponseListner.Check()) |
|
218 aContext->iResponseListner.Complete(KErrNone); |
|
219 } |
|
220 |
|
221 return aContext->StateFactory().getStateL(EWaitForClient); |
|
222 } |
|
223 |
|
224 TStateBase* TStateBase::handleConnectionStateChangedL(CMSRPServerSubSession *aContext) |
|
225 { |
|
226 TStateBase* state = NULL; |
|
227 TInt iConnectionEvent = aContext->iConnection->getConnectionState(); |
|
228 |
|
229 MSRPLOG2("handleConnectionStateChanged::Connection Event %d \n",iConnectionEvent ); |
|
230 |
|
231 switch(iConnectionEvent) |
|
232 { |
|
233 case -1: // Error Scenario |
|
234 state = handleConnectionErrorsL(aContext); |
|
235 break; |
|
236 |
|
237 case 1: |
|
238 case 2: |
|
239 MSRPLOG("handleConnectionStateChanged::Connection in Progress \n"); |
|
240 state = this; |
|
241 break; |
|
242 |
|
243 case 3: |
|
244 // Connected. |
|
245 MSRPLOG("handleConnectionStateChanged: Connected now." ); |
|
246 aContext->informConnectionReadyToClient(); |
|
247 state = aContext->StateFactory().getStateL(EWaitForClient); |
|
248 break; |
|
249 |
|
250 case 4: |
|
251 case 5: |
|
252 MSRPLOG("handleConnectionStateChanged: TimeOut now." ); |
|
253 if(EDownstream == aContext->iConnDirection) |
|
254 aContext->iConnectionListner.Complete(-33); // TODO : Change to query the exact erorr code from the connection. |
|
255 else |
|
256 aContext->iIncommingMessageListner.Complete(-33); // TODO : Change to query the exact erorr code from the connection. |
|
257 |
|
258 state = aContext->StateFactory().getStateL(EWaitForClient); |
|
259 break; |
|
260 |
|
261 case 0: |
|
262 // Not Connected. |
|
263 MSRPLOG("handleConnectionStateChanged: TimeOut now." ); |
|
264 state = this; |
|
265 break; |
|
266 } |
|
267 |
|
268 return state; |
|
269 } |
|
270 |
|
271 TStateBase* TStateBase::handleConnectionErrorsL(CMSRPServerSubSession *aContext) |
|
272 { |
|
273 TStateBase* state; |
|
274 if(TRUE == aContext->iConnectionListner.Check()) |
|
275 { |
|
276 // Have a connection listner to inform connection errors. |
|
277 // This scenario happens where there is a connection error during "Connect" |
|
278 |
|
279 aContext->iConnectionListner.Complete(KErrCouldNotConnect); // TODO : Change to query the exact erorr code from the connection. |
|
280 aContext->iConnection->ReleaseConnection(*aContext); |
|
281 aContext->iConnection = NULL; |
|
282 state = aContext->StateFactory().getStateL(EWaitForClient); |
|
283 } |
|
284 else |
|
285 { |
|
286 // If do not have a connection listner. |
|
287 // This is a case where a established connection(connect/listen) |
|
288 // is now reporting a Error. |
|
289 |
|
290 // ConnectionErrors in the current scheme of things will be reported via |
|
291 // iIncommingMessageListner. |
|
292 |
|
293 if(!aContext->iIncommingMessageListner.Check()) |
|
294 { |
|
295 // Case where the subsession is waiting for the Client subsessions |
|
296 // to provide it with listner to reports issues on. |
|
297 // Just move to the EIdle state. EIdle is the not connected state. |
|
298 |
|
299 // The connection error here will be reported from the TIdle state. |
|
300 |
|
301 state = aContext->StateFactory().getStateL(EIdle); |
|
302 } |
|
303 else |
|
304 { |
|
305 aContext->iIncommingMessageListner.Complete(KErrDisconnected); |
|
306 aContext->iConnection->ReleaseConnection(*aContext); |
|
307 aContext->iConnection = NULL; |
|
308 state = aContext->StateFactory().getStateL(EIdle); |
|
309 } |
|
310 } |
|
311 return state; |
|
312 } |
|
313 |
|
314 TStateBase* TStateBase::handleQueuesL(CMSRPServerSubSession *aContext) |
|
315 { |
|
316 TStateBase * state; |
|
317 |
|
318 if( aContext->QueuesEmpty() ) |
|
319 { |
|
320 state = aContext->StateFactory().getStateL( EActive ); |
|
321 } |
|
322 else |
|
323 { |
|
324 if( CMSRPServerSubSession::TInCommingMsgQueue == |
|
325 aContext->getQToProcess() ) |
|
326 state = processIncommingMessageL( aContext ); |
|
327 else |
|
328 state = processPendingMessageQL( aContext ); |
|
329 } |
|
330 |
|
331 return state; |
|
332 } |
|
333 |
|
334 TStates TStateIdle::identity() |
|
335 { |
|
336 return EIdle; |
|
337 } |
|
338 |
|
339 TStateBase* TStateIdle::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
|
340 { |
|
341 // TStateIdle is a state where the subsession is waiting to get connected. |
|
342 // It is the first state which is entered post sub-session creation. |
|
343 // Also it is the state that is entered in case there is of a connection error. |
|
344 |
|
345 // It may be possible that the client could not be informed about the |
|
346 // connection error. Thus any client listner setup events will inform the client about |
|
347 // the current disconnected state. |
|
348 |
|
349 // Any existing queues of received messages, received client send requests would be |
|
350 // retained as it is. Any events for send messages received from the client |
|
351 // would be queued up. |
|
352 |
|
353 // An event from the connection layer is considered invalid as the connection is |
|
354 // assumed to be dead. Such events will result in a error report being published. |
|
355 |
|
356 MSRPLOG2("Entered TStateIdle Event %d",aEvent); |
|
357 TStateBase* state; |
|
358 |
|
359 switch(aEvent) |
|
360 { |
|
361 case ELocalMSRPPathEvent: |
|
362 state = handleLocalMSRPPathRequestL(aContext); |
|
363 break; |
|
364 |
|
365 case EMSRPConnectEvent: |
|
366 aContext->iConnDirection = EDownstream; |
|
367 state = handleConnectRequestL(aContext); |
|
368 break; |
|
369 |
|
370 case EMSRPListenEvent: |
|
371 aContext->iConnDirection = EUpstream; |
|
372 state = handleListenRequestL( aContext ); |
|
373 break; |
|
374 |
|
375 case EMSRPListenMessagesEvent: |
|
376 case EMSRPListenSendResultEvent: |
|
377 // A MSRP Connection error code would be more appropriate here. |
|
378 aContext->CompleteClient(KErrCouldNotConnect); |
|
379 state = this; |
|
380 break; |
|
381 |
|
382 case EMSRPCancelReceivingEvent: |
|
383 case EMSRPCancelSendRespListeningEvent: |
|
384 state = handleClientListnerCancelL(aContext, aEvent); |
|
385 break; |
|
386 |
|
387 case EConnectionStateChangedEvent: |
|
388 state = handleConnectionStateChangedL(aContext); |
|
389 break; |
|
390 |
|
391 default: |
|
392 // Any such error usually a client/server protocol voilation. |
|
393 // A bug to fix. |
|
394 MSRPLOG2("TStateIdle::EventL :: Err!! Invalid state to have received %d",aEvent); |
|
395 state = HandleStateErrorL(aContext); |
|
396 break; |
|
397 } |
|
398 return state; |
|
399 } |
|
400 |
|
401 TStateBase* TStateIdle::handleLocalMSRPPathRequestL( CMSRPServerSubSession *aContext) |
|
402 { |
|
403 // The function is reponsible for contructing a Local MSRP path and returning it to the |
|
404 // client. |
|
405 // path:msrp://atlanta.example.com:7654/jshA7weztas;tcp |
|
406 |
|
407 // !! The current implementation should change to fully construct a MSRP path in the |
|
408 // subsessoin and send back the result as path buffer. Right now this done in the client. !! |
|
409 |
|
410 MSRPLOG("TStateIdle::HandleLocalPathRequestL()"); |
|
411 |
|
412 TInetAddr localAddr; |
|
413 aContext->ConnectionManager().ResolveLocalIPAddressL( localAddr ); |
|
414 localAddr.Output(aContext->iLocalHost); |
|
415 |
|
416 aContext->iLocalPathMSRPDataPckg().iLocalHost.Copy( aContext->iLocalHost ); |
|
417 aContext->iLocalPathMSRPDataPckg().iSessionID = *(aContext->iLocalSessionID); |
|
418 |
|
419 TInt reason = aContext->Write(0, aContext->iLocalPathMSRPDataPckg); |
|
420 aContext->CompleteClient(KErrNone); |
|
421 |
|
422 return this; // No state change. |
|
423 } |
|
424 |
|
425 TStateBase* TStateIdle::handleConnectRequestL(CMSRPServerSubSession *aContext) |
|
426 { |
|
427 |
|
428 if(!aContext->iConnectionListner.set(*(aContext->iClientMessage))) |
|
429 { |
|
430 MSRPLOG("TStateIdle::handleConnectRequestL() iConnectionListner is already setup"); |
|
431 MSRPLOG("TStateIdle::handleConnectRequestL() Invalid state to setup for ConnectionListner"); |
|
432 return HandleStateErrorL(aContext); |
|
433 } |
|
434 aContext->iClientMessage = NULL; |
|
435 |
|
436 aContext->iConnectionListner.ReadL( 0, aContext->iConnectMSRPdataPckg ); |
|
437 |
|
438 aContext->iRemoteHost = aContext->iConnectMSRPdataPckg().iRemoteHost; |
|
439 aContext->iRemotePort = aContext->iConnectMSRPdataPckg().iRemotePort; |
|
440 |
|
441 aContext->iRemoteSessionID = |
|
442 HBufC8::NewL( aContext->iConnectMSRPdataPckg().iRemoteSessionID.Length()); |
|
443 |
|
444 *(aContext->iRemoteSessionID) = |
|
445 aContext->iConnectMSRPdataPckg().iRemoteSessionID; |
|
446 |
|
447 // Request for a Connection. |
|
448 MMSRPConnection &connection = |
|
449 aContext->ConnectionManager().getConnectionL( |
|
450 aContext->iRemoteHost |
|
451 ,aContext->iRemotePort); |
|
452 aContext->iConnection = &connection; |
|
453 |
|
454 TBool connReady = initializeConnectionL(aContext); |
|
455 |
|
456 if(!connReady) |
|
457 { |
|
458 MSRPLOG("TStateIdle:: Transtion to State EConnecting" ); |
|
459 return aContext->StateFactory().getStateL(EConnecting); |
|
460 } |
|
461 else |
|
462 { |
|
463 MSRPLOG("TStateIdle:: Transtion to State EConnecting" ); |
|
464 aContext->informConnectionReadyToClient(); |
|
465 return aContext->StateFactory().getStateL(EWaitForClient); |
|
466 } |
|
467 } |
|
468 |
|
469 TStateBase* TStateIdle::handleListenRequestL(CMSRPServerSubSession *aContext) |
|
470 { |
|
471 if(!aContext->iIncommingMessageListner.set(*(aContext->iClientMessage))) |
|
472 { |
|
473 MSRPLOG("TStateWaitForClient::EventL iIncomming listner is already setup"); |
|
474 MSRPLOG("TStateWaitForClient::EventL Invalid state to setup a listner"); |
|
475 return HandleStateErrorL(aContext); |
|
476 } |
|
477 aContext->iClientMessage = NULL; |
|
478 aContext->iIncommingMessageListner.ReadL( 0, aContext->iListenMSRPdataPckg ); |
|
479 |
|
480 aContext->iRemoteHost = aContext->iListenMSRPdataPckg().iRemoteHost; |
|
481 aContext->iRemotePort = aContext->iListenMSRPdataPckg().iRemotePort; |
|
482 aContext->iRemoteSessionID = |
|
483 HBufC8::NewL( aContext->iListenMSRPdataPckg().iRemoteSessionID.Length()); |
|
484 |
|
485 *(aContext->iRemoteSessionID) = |
|
486 aContext->iListenMSRPdataPckg().iRemoteSessionID; |
|
487 |
|
488 // Request for a Connection. |
|
489 MMSRPConnection &connection = |
|
490 aContext->ConnectionManager().getConnectionL( |
|
491 aContext->iRemoteHost |
|
492 ,aContext->iRemotePort); |
|
493 aContext->iConnection = &connection; |
|
494 |
|
495 TBool connReady = initializeConnectionL(aContext); |
|
496 |
|
497 if(!connReady) |
|
498 { |
|
499 MSRPLOG("TStateIdle:: Transtion to State EConnecting" ); |
|
500 return aContext->StateFactory().getStateL(EConnecting); |
|
501 } |
|
502 else |
|
503 { |
|
504 MSRPLOG("TStateIdle:: Transtion to State EConnecting" ); |
|
505 aContext->informConnectionReadyToClient(); |
|
506 return aContext->StateFactory().getStateL(EWaitForClient); |
|
507 } |
|
508 } |
|
509 |
|
510 TBool TStateIdle::initializeConnectionL(CMSRPServerSubSession *aContext) |
|
511 { |
|
512 // Connect or Listen on Connection. |
|
513 // Return status based on connection is ready for use or not. |
|
514 TBool retVal = FALSE; |
|
515 |
|
516 if(EDownstream == aContext->iConnDirection) |
|
517 { |
|
518 if(3 == aContext->iConnection->ConnectL(*aContext)) |
|
519 retVal = TRUE; |
|
520 } |
|
521 else |
|
522 { |
|
523 if(3 == aContext->iConnection->ListenL(*aContext)) |
|
524 retVal = TRUE; |
|
525 } |
|
526 |
|
527 return retVal; |
|
528 } |
|
529 |
|
530 TStates TStateConnecting::identity() |
|
531 { |
|
532 return EConnecting; |
|
533 } |
|
534 |
|
535 TStateBase* TStateConnecting::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
|
536 { |
|
537 MSRPLOG2("Entered TStateConnecting Event %d",aEvent); |
|
538 TStateBase *state; |
|
539 |
|
540 switch(aEvent) |
|
541 { |
|
542 case EConnectionStateChangedEvent: |
|
543 state = handleConnectionStateChangedL(aContext); |
|
544 break; |
|
545 |
|
546 default: |
|
547 MSRPLOG2("TStateConnecting::EventL :: Err!! Invalid state to have received %d", |
|
548 aEvent); |
|
549 state = HandleStateErrorL(aContext); |
|
550 break; |
|
551 } |
|
552 |
|
553 return state; |
|
554 } |
|
555 |
|
556 TStateBase* TStateWaitForClient::fileSendCompleteL(CMSRPServerSubSession *aContext) |
|
557 { |
|
558 CMSRPMessageHandler *outgoingMessageHandler = aContext->iOutMsgQ.getHead(); |
|
559 |
|
560 if( outgoingMessageHandler && outgoingMessageHandler->IsMessageComplete() ) |
|
561 { |
|
562 aContext->iOutMsgQ.explicitRemove(outgoingMessageHandler); |
|
563 delete outgoingMessageHandler; |
|
564 aContext->iSendCompleteNotify = TRUE; |
|
565 } |
|
566 return aContext->StateFactory().getStateL( EWaitForClient ); |
|
567 } |
|
568 |
|
569 TStateBase * TStateWaitForClient::handleResponseSentL( CMSRPServerSubSession *aContext) |
|
570 { |
|
571 CMSRPMessageHandler *oriMessageHandler = aContext->iReceiveFileMsgHdler; |
|
572 oriMessageHandler->UpdateResponseStateL(aContext->iReceivedResp); |
|
573 if(oriMessageHandler->FileTransferComplete() ) |
|
574 { |
|
575 aContext->iReceiveCompleteNotify = TRUE; |
|
576 } |
|
577 |
|
578 return aContext->StateFactory().getStateL(EWaitForClient); |
|
579 } |
|
580 |
|
581 TStates TStateWaitForClient::identity() |
|
582 { |
|
583 return EWaitForClient; |
|
584 } |
|
585 |
|
586 TStateBase* TStateBase::handleSendFileL(CMSRPServerSubSession *aContext) |
|
587 { |
|
588 MSRPLOG("TStateBase::handleSendFileL() enter"); |
|
589 aContext->ReadSendDataPckgL(); |
|
590 CMSRPMessageHandler *aMessageHandler = CMSRPMessageHandler::NewL(aContext, |
|
591 aContext->iSendMSRPdataPckg().iExtMessageBuffer); |
|
592 |
|
593 aMessageHandler->SendFileL(*aContext->iConnection); |
|
594 |
|
595 aContext->iOutMsgQ.Queue(*aMessageHandler); |
|
596 aContext->CompleteClient( KErrNone ); |
|
597 |
|
598 aContext->iFileShare = TRUE; |
|
599 MSRPLOG("TStateBase::handleSendFileL() exit"); |
|
600 if(!aContext->listnerSetupComplete()) |
|
601 { |
|
602 return aContext->StateFactory().getStateL(EWaitForClient); |
|
603 } |
|
604 |
|
605 return aContext->StateFactory().getStateL(EFileShare); |
|
606 } |
|
607 |
|
608 TStateBase* TStateBase::handleReceiveFileL(CMSRPServerSubSession *aContext) |
|
609 { |
|
610 MSRPLOG("TStateBase::handleReceiveFileL() enter"); |
|
611 |
|
612 aContext->ReadSendDataPckgL(); |
|
613 |
|
614 aContext->iReceiveFileMsgHdler = CMSRPMessageHandler::NewL(aContext, |
|
615 aContext->iSendMSRPdataPckg().iExtMessageBuffer); |
|
616 |
|
617 |
|
618 aContext->iReceiveFileMsgHdler->ReceiveFileL(); |
|
619 aContext->CompleteClient( KErrNone ); |
|
620 aContext->iFileShare = TRUE; |
|
621 MSRPLOG("TStateBase::handleReceiveFileL() exit"); |
|
622 if(!aContext->listnerSetupComplete()) |
|
623 { |
|
624 return aContext->StateFactory().getStateL(EWaitForClient); |
|
625 } |
|
626 |
|
627 return aContext->StateFactory().getStateL(EFileShare); |
|
628 } |
|
629 |
|
630 TStateBase* TStateWaitForClient::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
|
631 { |
|
632 // In the TStateWaitForClient stat the server subsession waits for the client to setup |
|
633 // handlers to receive requests/responses/reports from the MSRP peer. |
|
634 // TODO - TStateWaitForClient can be removed. Replace this with a eventQueue implementation. |
|
635 |
|
636 MSRPLOG2("Entered TStateWaitForClient Event %d",aEvent); |
|
637 |
|
638 TStateBase *state = NULL; |
|
639 switch(aEvent) |
|
640 { |
|
641 case EMSRPListenMessagesEvent: |
|
642 if(!aContext->iIncommingMessageListner.set(*(aContext->iClientMessage))) |
|
643 { |
|
644 MSRPLOG("TStateWaitForClient::EventL iIncomming listner is already setup"); |
|
645 MSRPLOG2("TStateWaitForClient::EventL Invalid state to have received %d", aEvent); |
|
646 } |
|
647 aContext->iClientMessage = NULL; |
|
648 break; |
|
649 |
|
650 case EMSRPListenSendResultEvent: |
|
651 if(!aContext->iResponseListner.set(*(aContext->iClientMessage))) |
|
652 { |
|
653 MSRPLOG("TStateWaitForClient::EventL SendResult Listner is already setup"); |
|
654 MSRPLOG2("TStateWaitForClient::EventL Invalid state to have received %d", aEvent); |
|
655 } |
|
656 aContext->iClientMessage = NULL; |
|
657 break; |
|
658 |
|
659 case EMSRPIncomingMessageReceivedEvent: |
|
660 // Queue any thing that comes. |
|
661 aContext->iInCommingMsgQ.Queue(*aContext->iReceivedMsg); |
|
662 break; |
|
663 |
|
664 case EMSRPDataSendCompleteEvent: |
|
665 // Data Send Complete received in the TWaitForClient state is |
|
666 // not handeled. At Data Send Complete messae with Failure Report |
|
667 // header set to "no" need to inform the client about completion. |
|
668 // Currently Queuing of completion events is not supported. |
|
669 if(aContext->iFileShare) |
|
670 { |
|
671 state = fileSendCompleteL(aContext); |
|
672 break; |
|
673 } |
|
674 MSRPLOG2("TStateWaitForClient::Not supported, Please check %d",aEvent); |
|
675 break; |
|
676 |
|
677 case EMSRPResponseSendCompleteEvent: |
|
678 if(aContext->iFileShare) |
|
679 { |
|
680 state = handleResponseSentL(aContext); |
|
681 break; |
|
682 } |
|
683 break; |
|
684 |
|
685 case EMSRPDataSendMessageEvent: |
|
686 aContext->QueueClientSendRequestsL(); |
|
687 break; |
|
688 |
|
689 case EMSRPCancelReceivingEvent: |
|
690 case EMSRPCancelSendRespListeningEvent: |
|
691 handleClientListnerCancelL(aContext, aEvent); |
|
692 break; |
|
693 |
|
694 case EConnectionStateChangedEvent: |
|
695 state = handleConnectionStateChangedL(aContext); |
|
696 break; |
|
697 |
|
698 case EMSRPSendProgressEvent: |
|
699 case EMSRPReceiveProgressEvent: |
|
700 //ignore event if no listener |
|
701 MSRPLOG("TStateWaitForClient::EventL Ignoring Progress Event") |
|
702 state = aContext->StateFactory().getStateL(EWaitForClient); |
|
703 break; |
|
704 |
|
705 case EMSRPSendFileEvent: |
|
706 state = handleSendFileL(aContext); |
|
707 break; |
|
708 |
|
709 case EMSRPReceiveFileEvent : |
|
710 state = handleReceiveFileL(aContext); |
|
711 break; |
|
712 |
|
713 default: |
|
714 // Any such error usually a client/server protocol voilation or connection/subsession |
|
715 // protocol voilation. A bug to fix!! |
|
716 |
|
717 MSRPLOG2("TStateWaitForClient::EventL :: Err!! Invalid state to have received %d",aEvent); |
|
718 state = HandleStateErrorL(aContext); |
|
719 break; |
|
720 }; |
|
721 |
|
722 if(NULL == state) |
|
723 { |
|
724 // State not set. |
|
725 if(!aContext->listnerSetupComplete()) |
|
726 { |
|
727 state = this; |
|
728 } |
|
729 else if (aContext->iFileShare) |
|
730 { |
|
731 state = aContext->StateFactory().getStateL(EFileShare); |
|
732 |
|
733 if(aContext->iReceiveCompleteNotify) |
|
734 { |
|
735 aContext->NotifyFileReceiveResultToClientL(NULL); |
|
736 state = aContext->StateFactory().getStateL(EWaitForClient); |
|
737 } |
|
738 else if (aContext->iSendCompleteNotify) |
|
739 { |
|
740 aContext->NotifyFileSendResultToClientL(NULL); |
|
741 state = aContext->StateFactory().getStateL(EWaitForClient); |
|
742 } |
|
743 else if(!aContext->QueuesEmpty()) |
|
744 state = state->handleQueuesL(aContext); |
|
745 } |
|
746 else |
|
747 state = handleQueuesL(aContext); |
|
748 } |
|
749 return state; |
|
750 } |
|
751 |
|
752 TStates TStateActive::identity() |
|
753 { |
|
754 return EActive; |
|
755 } |
|
756 |
|
757 TStateBase* TStateActive::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
|
758 { |
|
759 // TStateActive is entered when the subsession is in a connected state and client setup |
|
760 // is done. |
|
761 |
|
762 MSRPLOG2("Entered TStateActive Event %d",aEvent); |
|
763 |
|
764 TStateBase *state; |
|
765 switch(aEvent) |
|
766 { |
|
767 case EMSRPDataSendMessageEvent: |
|
768 state = handleSendDataL(aContext); |
|
769 break; |
|
770 |
|
771 case EMSRPIncomingMessageReceivedEvent: |
|
772 state = handleInCommingMessagesL(aContext); |
|
773 break; |
|
774 |
|
775 case EMSRPSendFileEvent: |
|
776 state = handleSendFileL(aContext); |
|
777 break; |
|
778 |
|
779 case EMSRPReceiveFileEvent : |
|
780 state = handleReceiveFileL(aContext); |
|
781 break; |
|
782 |
|
783 case EConnectionStateChangedEvent: |
|
784 state = handleConnectionStateChangedL(aContext); |
|
785 break; |
|
786 |
|
787 case EMSRPCancelReceivingEvent: |
|
788 case EMSRPCancelSendRespListeningEvent: |
|
789 state = handleClientListnerCancelL(aContext, aEvent); |
|
790 break; |
|
791 |
|
792 default: |
|
793 // Any such error usually a client/server protocol voilation or connection/subsession |
|
794 // protocol voilation. A bug to fix!! |
|
795 |
|
796 MSRPLOG2("TStateActive::EventL :: Err!! Invalid state to have received %d",aEvent); |
|
797 state = HandleStateErrorL(aContext); |
|
798 break; |
|
799 } |
|
800 |
|
801 return state; |
|
802 } |
|
803 |
|
804 TStateBase* TStateActive::handleSendDataL(CMSRPServerSubSession *aContext) |
|
805 { |
|
806 MSRPLOG("TStateActive::handleSendDataL()"); |
|
807 |
|
808 aContext->ReadSendDataPckgL(); |
|
809 |
|
810 CMSRPMessageHandler *msgHandler |
|
811 = CMSRPMessageHandler::NewL(aContext, |
|
812 aContext->iSendMSRPdataPckg().iExtMessageBuffer); |
|
813 |
|
814 msgHandler->SendMessageL( *aContext->iConnection ); |
|
815 aContext->iCurrentMsgHandler = msgHandler; |
|
816 |
|
817 aContext->CompleteClient( KErrNone ); |
|
818 |
|
819 return aContext->StateFactory().getStateL(EActiveSend); |
|
820 } |
|
821 |
|
822 TStateBase* TStateBase::handleInCommingMessagesL(CMSRPServerSubSession *aContext) |
|
823 { |
|
824 CMSRPMessageHandler* incommingMsg = aContext->iReceivedMsg; |
|
825 aContext->iReceivedMsg = NULL; |
|
826 |
|
827 return processIncommingMessageL(aContext, incommingMsg); |
|
828 } |
|
829 |
|
830 TStates TStateFileShare::identity() |
|
831 { |
|
832 return EFileShare; |
|
833 } |
|
834 |
|
835 TStateBase* TStateFileShare::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
|
836 { |
|
837 TStateBase *state = NULL; |
|
838 MSRPLOG2("Entered TStateFileShare Event %d",aEvent); |
|
839 switch(aEvent) |
|
840 { |
|
841 case EMSRPDataSendCompleteEvent: // maps to file send complete |
|
842 state = fileSendCompleteL(aContext); |
|
843 break; |
|
844 |
|
845 case EMSRPIncomingMessageReceivedEvent: // incoming responses to file chunks |
|
846 state = handleInCommingMessagesL(aContext); |
|
847 break; |
|
848 |
|
849 case EMSRPResponseSendCompleteEvent: |
|
850 state = handleResponseSentL(aContext); |
|
851 break; |
|
852 |
|
853 case EMSRPSendProgressEvent: |
|
854 state = handleSendProgressL(aContext); |
|
855 break; |
|
856 |
|
857 case EMSRPReceiveProgressEvent: |
|
858 state = handleReceiveProgressL(aContext); |
|
859 break; |
|
860 |
|
861 case EConnectionStateChangedEvent : |
|
862 state = handleConnectionStateChangedL(aContext); |
|
863 break; |
|
864 |
|
865 |
|
866 case EMSRPCancelReceivingEvent: |
|
867 case EMSRPCancelSendRespListeningEvent: |
|
868 state = handleClientListnerCancelL(aContext, aEvent); |
|
869 break; |
|
870 default: |
|
871 MSRPLOG2("TStateFileShare::EventL :: Err!! Invalid state to have received %d",aEvent); |
|
872 // state = HandleStateErrorL(aContext); //handle error state |
|
873 break; |
|
874 |
|
875 } |
|
876 return state; |
|
877 } |
|
878 |
|
879 TStateBase * TStateFileShare::handleSendProgressL( CMSRPServerSubSession *aContext) |
|
880 { |
|
881 CMSRPMessageHandler *outgoingMessageHandler = aContext->iOutMsgQ.getHead(); |
|
882 aContext->SendProgressToClientL(outgoingMessageHandler); |
|
883 return aContext->StateFactory().getStateL( EWaitForClient ); |
|
884 } |
|
885 |
|
886 TStateBase * TStateFileShare::handleReceiveProgressL( CMSRPServerSubSession *aContext) |
|
887 { |
|
888 CMSRPMessageHandler *oriMessageHandler = aContext->iReceiveFileMsgHdler; |
|
889 aContext->ReceiveProgressToClientL(oriMessageHandler); |
|
890 return aContext->StateFactory().getStateL( EWaitForClient ); |
|
891 } |
|
892 |
|
893 TStateBase * TStateFileShare::handleResponseSentL( CMSRPServerSubSession *aContext) |
|
894 { |
|
895 CMSRPMessageHandler *oriMessageHandler = aContext->iReceiveFileMsgHdler; |
|
896 oriMessageHandler->UpdateResponseStateL(aContext->iReceivedResp); |
|
897 |
|
898 |
|
899 if(oriMessageHandler->FileTransferComplete() ) |
|
900 { |
|
901 //Notify client |
|
902 aContext->NotifyFileReceiveResultToClientL(oriMessageHandler); |
|
903 delete oriMessageHandler; |
|
904 aContext->iReceiveFileMsgHdler = NULL; |
|
905 return aContext->StateFactory().getStateL(EWaitForClient); |
|
906 } |
|
907 |
|
908 if(!aContext->listnerSetupComplete()) |
|
909 { |
|
910 return aContext->StateFactory().getStateL(EWaitForClient); |
|
911 } |
|
912 |
|
913 return aContext->StateFactory().getStateL(EFileShare); |
|
914 |
|
915 } |
|
916 |
|
917 TStateBase * TStateFileShare::handlesResponseL(CMSRPServerSubSession *aContext, |
|
918 CMSRPMessageHandler *incommingMsgHandler) |
|
919 { |
|
920 TStateBase *nextState; |
|
921 MSRPLOG("TStateFileShare::handlesFileResponseL Entered!"); |
|
922 |
|
923 // Search the outgoing Queue to find the owner of this response. |
|
924 CMSRPMessageHandler *outgoingMsgHandler = |
|
925 aContext->iOutMsgQ.getMatch(incommingMsgHandler); |
|
926 |
|
927 nextState = this; |
|
928 if(NULL != outgoingMsgHandler) |
|
929 { |
|
930 CleanupStack::PushL(incommingMsgHandler); |
|
931 outgoingMsgHandler->ConsumeFileResponseL(*incommingMsgHandler); |
|
932 |
|
933 if(outgoingMsgHandler->FileTransferComplete()) |
|
934 { |
|
935 //notify client |
|
936 aContext->NotifyFileSendResultToClientL(outgoingMsgHandler); |
|
937 aContext->iOutMsgQ.explicitRemove(outgoingMsgHandler); |
|
938 delete outgoingMsgHandler; |
|
939 nextState = aContext->StateFactory().getStateL(EWaitForClient); |
|
940 } |
|
941 |
|
942 CleanupStack::Pop(incommingMsgHandler); |
|
943 } |
|
944 delete incommingMsgHandler; |
|
945 MSRPLOG("TStateFileShare::handlesResponseL Exit!"); |
|
946 if(!aContext->listnerSetupComplete()) |
|
947 { |
|
948 return aContext->StateFactory().getStateL(EWaitForClient); |
|
949 } |
|
950 return nextState; |
|
951 } |
|
952 |
|
953 TStateBase * TStateFileShare::handleRequestsL(CMSRPServerSubSession *aContext, |
|
954 CMSRPMessageHandler *incommingMsgHandler) |
|
955 { |
|
956 if(MMSRPIncomingMessage::EMSRPMessage == incommingMsgHandler->MessageType()) |
|
957 { |
|
958 CMSRPMessageHandler *oriMessageHandler = aContext->iReceiveFileMsgHdler; |
|
959 |
|
960 if(oriMessageHandler->IsInFile()) |
|
961 { |
|
962 oriMessageHandler->WritetoFileL(incommingMsgHandler); |
|
963 incommingMsgHandler->SendResponseL(aContext, *aContext->iConnection,CMSRPResponse::EAllOk); |
|
964 if(!incommingMsgHandler->IfResponseReqL()) |
|
965 { |
|
966 delete incommingMsgHandler; |
|
967 if(oriMessageHandler->FileTransferComplete()) |
|
968 { |
|
969 aContext->NotifyFileReceiveResultToClientL(oriMessageHandler); |
|
970 delete oriMessageHandler; |
|
971 aContext->iReceiveFileMsgHdler = NULL; |
|
972 return aContext->StateFactory().getStateL(EWaitForClient); |
|
973 } |
|
974 } |
|
975 |
|
976 else |
|
977 { |
|
978 aContext->iPendingForDeletionQ.Queue(*incommingMsgHandler); |
|
979 } |
|
980 } |
|
981 } |
|
982 else |
|
983 { |
|
984 MSRPLOG("Reports not supported.!!"); |
|
985 delete incommingMsgHandler; |
|
986 } |
|
987 if(!aContext->listnerSetupComplete()) |
|
988 { |
|
989 return aContext->StateFactory().getStateL(EWaitForClient); |
|
990 } |
|
991 return this; |
|
992 } |
|
993 |
|
994 TStateBase* TStateFileShare::fileSendCompleteL(CMSRPServerSubSession *aContext) |
|
995 { |
|
996 CMSRPMessageHandler *outgoingMessageHandler = aContext->iOutMsgQ.getHead(); |
|
997 |
|
998 if( outgoingMessageHandler && outgoingMessageHandler->IsMessageComplete() ) |
|
999 { |
|
1000 //notify client |
|
1001 aContext->NotifyFileSendResultToClientL( outgoingMessageHandler ); |
|
1002 aContext->iOutMsgQ.explicitRemove(outgoingMessageHandler); |
|
1003 delete outgoingMessageHandler; |
|
1004 return aContext->StateFactory().getStateL( EWaitForClient ); |
|
1005 } |
|
1006 // response needed keep it on the outmsg queue itself |
|
1007 return aContext->StateFactory().getStateL( EFileShare ); |
|
1008 } |
|
1009 |
|
1010 TStates TStateActiveSend::identity() |
|
1011 { |
|
1012 return EActiveSend; |
|
1013 } |
|
1014 |
|
1015 TStateBase* TStateActiveSend::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
|
1016 { |
|
1017 // ActiveSend state. The subsession is busy sending earlier data. Any further requests to |
|
1018 // send data from the client will be queued. Any Message received will be queued till |
|
1019 // EMSRPDataSendCompleteEvent is received. |
|
1020 // After this Message Received Queue will be processed to check for any |
|
1021 // incoming messages/responses. |
|
1022 // After that Message send queue will be processed to see if there any pending messages to |
|
1023 // trasmitt. |
|
1024 // If both the queues are empty move back to Active State. |
|
1025 |
|
1026 TStateBase *state; |
|
1027 MSRPLOG2("Entered TStateActiveSend Event %d",aEvent); |
|
1028 |
|
1029 switch(aEvent) |
|
1030 { |
|
1031 case EMSRPDataSendMessageEvent: |
|
1032 aContext->QueueClientSendRequestsL(); |
|
1033 state = this; |
|
1034 break; |
|
1035 |
|
1036 case EMSRPDataSendCompleteEvent: |
|
1037 state = MessageSendCompleteL(aContext); |
|
1038 break; |
|
1039 |
|
1040 case EMSRPIncomingMessageReceivedEvent: |
|
1041 // Queue any thing that comes. |
|
1042 aContext->iInCommingMsgQ.Queue(*aContext->iReceivedMsg); |
|
1043 state = this; |
|
1044 break; |
|
1045 |
|
1046 case EConnectionStateChangedEvent: |
|
1047 state = handleConnectionStateChangedL(aContext); |
|
1048 break; |
|
1049 |
|
1050 case EMSRPCancelReceivingEvent: |
|
1051 case EMSRPCancelSendRespListeningEvent: |
|
1052 state = handleClientListnerCancelL(aContext, aEvent); |
|
1053 break; |
|
1054 |
|
1055 default: |
|
1056 // Any such error usually a client/server protocol voilation or connection/subsession |
|
1057 // protocol voilation. A bug to fix!! |
|
1058 |
|
1059 MSRPLOG2("TStateActiveSend::EventL :: Err!! Invalid state to have received %d",aEvent); |
|
1060 state = HandleStateErrorL(aContext); |
|
1061 break; |
|
1062 } |
|
1063 return state; |
|
1064 } |
|
1065 |
|
1066 TStateBase * TStateActiveSend::MessageSendCompleteL(CMSRPServerSubSession *aContext) |
|
1067 { |
|
1068 // Handle send message complete event. |
|
1069 if( NULL == aContext->iCurrentMsgHandler) |
|
1070 { |
|
1071 MSRPLOG( "TStateActiveSend::MessageSendCompleteL :: iCurrentMsgHandler is NULL \n" ); |
|
1072 return this; |
|
1073 } |
|
1074 |
|
1075 if( aContext->iCurrentMsgHandler->IsMessageComplete() ) |
|
1076 { |
|
1077 // Messages with Failure Report set to "No" will never get a response. |
|
1078 TBool error = aContext->sendResultToClientL( aContext->iCurrentMsgHandler ); |
|
1079 delete aContext->iCurrentMsgHandler; |
|
1080 aContext->iCurrentMsgHandler = NULL; |
|
1081 |
|
1082 return aContext->StateFactory().getStateL( EWaitForClient ); |
|
1083 } |
|
1084 else |
|
1085 { |
|
1086 // Message expects a response to come. Put this out the OutGoing Queue. |
|
1087 aContext->iOutMsgQ.Queue( *(aContext->iCurrentMsgHandler) ); |
|
1088 aContext->iCurrentMsgHandler = NULL; |
|
1089 |
|
1090 // Handle any pending events in Queue. |
|
1091 return handleQueuesL(aContext); |
|
1092 } |
|
1093 } |
|
1094 |
|
1095 |
|
1096 TStates TStateError::identity() |
|
1097 { |
|
1098 return EError; |
|
1099 } |
|
1100 |
|
1101 TStateBase* TStateError::EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext) |
|
1102 { |
|
1103 // Error State is entered when we receive an Error Response from the opposite |
|
1104 // end point to which we sent a SEND request. When this state is entered the client |
|
1105 // is expected to close the session without trying to send further messages. |
|
1106 |
|
1107 MSRPLOG2("Entered TStateError Event %d", aEvent); |
|
1108 TStateBase *state; |
|
1109 |
|
1110 switch(aEvent) |
|
1111 { |
|
1112 case EMSRPListenMessagesEvent: |
|
1113 aContext->CompleteClient(KErrCouldNotConnect); |
|
1114 state = this; |
|
1115 break; |
|
1116 |
|
1117 case EMSRPListenSendResultEvent: |
|
1118 aContext->CompleteClient(EInvalidAction); |
|
1119 state = this; |
|
1120 break; |
|
1121 |
|
1122 case EMSRPDataSendMessageEvent: |
|
1123 aContext->CompleteClient(KErrNone); |
|
1124 state = this; |
|
1125 break; |
|
1126 |
|
1127 case EMSRPCancelReceivingEvent: |
|
1128 case EMSRPCancelSendRespListeningEvent: |
|
1129 state = handleClientListnerCancelL(aContext, aEvent); |
|
1130 break; |
|
1131 |
|
1132 case EMSRPIncomingMessageReceivedEvent: |
|
1133 aContext->iInCommingMsgQ.Queue(*aContext->iReceivedMsg); |
|
1134 state = this; |
|
1135 break; |
|
1136 |
|
1137 case EConnectionStateChangedEvent: |
|
1138 state = handleConnectionStateChangedL(aContext); |
|
1139 break; |
|
1140 |
|
1141 default: |
|
1142 MSRPLOG2("TStateError::EventL :: Err!! Invalid state to have received %d",aEvent); |
|
1143 state = HandleStateErrorL(aContext); |
|
1144 break; |
|
1145 } |
|
1146 return state; |
|
1147 } |