datacommsserver/esockserver/ssock/ss_connstates.cpp
changeset 1 21d2ab05f085
parent 0 dfb7c4ff071f
child 4 928ed51ddc43
equal deleted inserted replaced
0:dfb7c4ff071f 1:21d2ab05f085
   166    		ac.iMessage.Complete(KErrNone);
   166    		ac.iMessage.Complete(KErrNone);
   167    		ac.iSubSession = NULL;
   167    		ac.iSubSession = NULL;
   168 		}
   168 		}
   169     else
   169     else
   170         {
   170         {
       
   171 		ac.iStartReceived = ETrue;
   171         ac.SetSelectionScope(TSelectionPrefs::EExplicitConnection);
   172         ac.SetSelectionScope(TSelectionPrefs::EExplicitConnection);
   172         }
   173         }
   173 	}
   174 	}
   174 
   175 
   175 DEFINE_SMELEMENT(ConnStates::TSendStartingSelectionStateChange, NetStateMachine::MStateTransition, ConnStates::TContext)
   176 DEFINE_SMELEMENT(ConnStates::TSendStartingSelectionStateChange, NetStateMachine::MStateTransition, ConnStates::TContext)
   843     // now be waiting upon the async ECNStart IPC to arrive before proceeding. The TCFInternalEsock::TSubSess
   844     // now be waiting upon the async ECNStart IPC to arrive before proceeding. The TCFInternalEsock::TSubSess
   844     // message will use the IPC number in the activity id part of aContext. MatchSender() will expect the
   845     // message will use the IPC number in the activity id part of aContext. MatchSender() will expect the
   845     // activity Id and so will never give a match. Here we ensure that our second IPC is matched and accepted.
   846     // activity Id and so will never give a match. Here we ensure that our second IPC is matched and accepted.
   846     
   847     
   847     TCFInternalEsock::TSubSess* msg = message_cast<TCFInternalEsock::TSubSess>(&aContext.iMessage);
   848     TCFInternalEsock::TSubSess* msg = message_cast<TCFInternalEsock::TSubSess>(&aContext.iMessage);
   848     if (!msg || msg->iMessage.Function() != ECNStart)
   849 	if (!msg || (msg->iMessage.Function() != ECNStart && msg->iMessage.Function() != ECNSetStartPrefs))
   849         {
   850         {
   850         return CNodeActivityBase::Next(aContext);
   851         return CNodeActivityBase::Next(aContext);
       
   852         }
       
   853     else if (iStartReceived)
       
   854         {
       
   855         // ECNSetStartPrefs should only ever be seen as the IPC in the TSubSess kick off message
       
   856         // ECNStart should only be seen once after an ECNSetStartPrefs or as the kick off message
       
   857         PanicClient(ETwice);
       
   858         aContext.iReturn = KErrInUse;
       
   859         return ETrue;
   851         }
   860         }
   852     
   861     
   853     MESH_LOG((KESockConnectionTag, _L8("CStartAttachActivity::Next:\tAccepted ECNStart IPC after ECNSetStartPrefs")));
   862     MESH_LOG((KESockConnectionTag, _L8("CStartAttachActivity::Next:\tAccepted ECNStart IPC after ECNSetStartPrefs")));
   854     TBool nextRet = ACore::Next(&aContext);
   863     TBool nextRet = ACore::Next(&aContext);
   855     if(nextRet)
   864     if(nextRet)
  1438 	}
  1447 	}
  1439 
  1448 
  1440 DEFINE_SMELEMENT(AllInterfaceNotificationActivity::TSendErrorToConnection, NetStateMachine::MStateTransition, TContext)
  1449 DEFINE_SMELEMENT(AllInterfaceNotificationActivity::TSendErrorToConnection, NetStateMachine::MStateTransition, TContext)
  1441 void AllInterfaceNotificationActivity::TSendErrorToConnection::DoL()
  1450 void AllInterfaceNotificationActivity::TSendErrorToConnection::DoL()
  1442 	{
  1451 	{
  1443 	// Send a TError to the CConnection to complete the shutdown handshake.
  1452 	iContext.Node().iConnection.iLegacyConnection.CompleteAllInterfaceNotificationL(iContext.Activity()->Error());
  1444 	RNodeInterface::OpenPostMessageClose(TNodeCtxId(iContext.ActivityId(), iContext.NodeId()), iContext.Node().iConnection.Id(), TEBase::TError(iContext.Activity()->KickOffMessageId(), KErrCancel).CRef());
  1453 
       
  1454 	TEBase::TError msg(iContext.Activity()->KickOffMessageId(), iContext.Activity()->Error());
       
  1455 	iContext.Activity()->PostToOriginators(msg);
       
  1456 
       
  1457 	iContext.Activity()->SetError(KErrNone);
  1445 	}
  1458 	}
  1446 
  1459 
  1447 DEFINE_SMELEMENT(TNoTagOrCancelAllInterfaceWorker, NetStateMachine::MStateFork, TContext)
  1460 DEFINE_SMELEMENT(TNoTagOrCancelAllInterfaceWorker, NetStateMachine::MStateFork, TContext)
  1448 TInt TNoTagOrCancelAllInterfaceWorker::TransitionTag()
  1461 TInt TNoTagOrCancelAllInterfaceWorker::TransitionTag()
  1449 	{
  1462 	{