319 //CloseConnection(); |
319 //CloseConnection(); |
320 |
320 |
321 MSRPLOG("CMSRPConnection::ReadStatusL() exit") |
321 MSRPLOG("CMSRPConnection::ReadStatusL() exit") |
322 } |
322 } |
323 |
323 |
324 void CMSRPConnection::ParseStatusL (CMSRPMessageHandler* aMsg, TInt aStatus) |
324 TInt CMSRPConnection::ParseStatusL (CMSRPMessageHandler* aMsg, TInt aStatus) |
325 { |
325 { |
326 MSRPLOG("CMSRPConnection::ParseStatus enter") |
326 MSRPLOG("CMSRPConnection::ParseStatus enter") |
327 if (aStatus != KErrNone) |
327 if (aStatus != KErrNone) |
328 { |
328 { |
329 NotifyAllL(EError, aStatus ); |
329 NotifyAllL(EError, aStatus ); |
330 //CloseConnection(); |
330 return MMSRPParserObserver::EParseStatusError; |
331 return; |
|
332 } |
331 } |
333 |
332 |
334 /*if error, count is zero*/ |
333 /*if error, count is zero*/ |
335 //while msg not consumed try to handover |
334 //while msg not consumed try to handover |
336 TBool consumed = FALSE; |
335 TBool consumed = FALSE; |
337 for ( TInt i = 0; (!consumed) && i < iSubsessions.Count(); i++ ) |
336 for ( TInt i = 0; (!consumed) && i < iSubsessions.Count(); i++ ) |
338 { |
337 { |
339 consumed = iSubsessions[ i ]->MessageReceivedL( aMsg ); |
338 TRAPD( err, consumed = iSubsessions[ i ]->MessageReceivedL( aMsg ) ); |
|
339 if ( err ) |
|
340 { |
|
341 // invalid message |
|
342 NotifyAllL( EError, err ); |
|
343 return MMSRPParserObserver::EParseStatusError; |
|
344 } |
340 } |
345 } |
341 |
346 |
342 //if unclaimed by any subsession, callback to first subsession |
347 //if unclaimed by any subsession, callback to first subsession |
343 if(!consumed && iSubsessions.Count()) |
348 if(!consumed && iSubsessions.Count()) |
344 { |
349 { |
345 iSubsessions[0]->UnclaimedMessageL( aMsg ); |
350 iSubsessions[0]->UnclaimedMessageL( aMsg ); |
|
351 return MMSRPParserObserver::EParseStatusMessageUnclaimed; |
346 } |
352 } |
347 |
353 |
348 MSRPLOG("CMSRPConnection::ParseStatus exit") |
354 MSRPLOG("CMSRPConnection::ParseStatus exit") |
|
355 return MMSRPParserObserver::EParseStatusMessageHandled; |
|
356 } |
|
357 |
|
358 // ----------------------------------------------------------------------------- |
|
359 // CMSRPConnection::ReportReceiveprogressL |
|
360 // ----------------------------------------------------------------------------- |
|
361 // |
|
362 void CMSRPConnection::ReportReceiveprogressL( CMSRPMessageHandler* aMsg ) |
|
363 { |
|
364 MSRPLOG("-> CMSRPConnection::ReportReceiveprogressL") |
|
365 |
|
366 for ( TInt i = 0; i < iSubsessions.Count(); i++ ) |
|
367 { |
|
368 TRAPD( err, iSubsessions[ i ]->MessageReceiveProgressL( aMsg ) ); |
|
369 if ( err ) |
|
370 { |
|
371 // invalid message |
|
372 NotifyAllL( EError, err ); |
|
373 return; |
|
374 } |
|
375 } |
|
376 |
|
377 MSRPLOG("<- CMSRPConnection::ReportReceiveprogressL") |
349 } |
378 } |
350 |
379 |
351 // ----------------------------------------------------------------------------- |
380 // ----------------------------------------------------------------------------- |
352 // CMSRPConnection::WriteSocketError |
381 // CMSRPConnection::WriteSocketError |
353 // ----------------------------------------------------------------------------- |
382 // ----------------------------------------------------------------------------- |
369 { |
398 { |
370 MSRPLOG("CMSRPConnection::SendL() enter") |
399 MSRPLOG("CMSRPConnection::SendL() enter") |
371 if(iConnectionState == EConnected) |
400 if(iConnectionState == EConnected) |
372 iWriter->RequestSendL(aMsg); |
401 iWriter->RequestSendL(aMsg); |
373 MSRPLOG("CMSRPConnection::SendL() exit") |
402 MSRPLOG("CMSRPConnection::SendL() exit") |
|
403 } |
|
404 |
|
405 // ----------------------------------------------------------------------------- |
|
406 // CMSRPConnection::ContinueSendingL |
|
407 // ----------------------------------------------------------------------------- |
|
408 // |
|
409 void CMSRPConnection::ContinueSendingL( MMSRPWriterObserver& aMsg ) |
|
410 { |
|
411 MSRPLOG("-> CMSRPConnection::ContinueSendingL") |
|
412 if( iConnectionState == EConnected ) |
|
413 { |
|
414 iWriter->RequestSendL( aMsg ); |
|
415 } |
|
416 MSRPLOG("<- CMSRPConnection::ContinueSendingL") |
|
417 } |
|
418 |
|
419 // ----------------------------------------------------------------------------- |
|
420 // CMSRPConnection::CancelSendingL |
|
421 // ----------------------------------------------------------------------------- |
|
422 // |
|
423 void CMSRPConnection::CancelSendingL( const MMSRPWriterObserver* aMsg ) |
|
424 { |
|
425 MSRPLOG("-> CMSRPConnection::CancelSendingL") |
|
426 if( iConnectionState == EConnected ) |
|
427 { |
|
428 iWriter->CancelSendingL( aMsg ); |
|
429 } |
|
430 MSRPLOG("<- CMSRPConnection::CancelSendingL") |
374 } |
431 } |
375 |
432 |
376 // ----------------------------------------------------------------------------- |
433 // ----------------------------------------------------------------------------- |
377 // CMSRPConnection::TimerExpired |
434 // CMSRPConnection::TimerExpired |
378 // ----------------------------------------------------------------------------- |
435 // ----------------------------------------------------------------------------- |