datacommsserver/esockserver/ssock/ss_conn.cpp
changeset 22 592244873960
parent 1 21d2ab05f085
child 25 e53adc4c49de
equal deleted inserted replaced
5:68ef71f0cd72 22:592244873960
   144 	// Handle error during start.
   144 	// Handle error during start.
   145 	THROUGH_NODEACTIVITY_ENTRY(ConnActivities::CStartAttachActivity::KCancelTag, MeshMachine::TDoNothing, MeshMachine::TErrorTag)	// just a tag
   145 	THROUGH_NODEACTIVITY_ENTRY(ConnActivities::CStartAttachActivity::KCancelTag, MeshMachine::TDoNothing, MeshMachine::TErrorTag)	// just a tag
   146 #ifdef SYMBIAN_NETWORKING_UPS
   146 #ifdef SYMBIAN_NETWORKING_UPS
   147 	THROUGH_NODEACTIVITY_ENTRY(CStartAttachActivity::KUpsErrorTag, TDoNothing, MeshMachine::TErrorTag)
   147 	THROUGH_NODEACTIVITY_ENTRY(CStartAttachActivity::KUpsErrorTag, TDoNothing, MeshMachine::TErrorTag)
   148 #endif
   148 #endif
       
   149 
       
   150 	// If there is a stop activity outstanding (it should be waiting for this activity to complete) then we will leave that to decide the fate of our service providers
       
   151 	THROUGH_NODEACTIVITY_ENTRY(KErrorTag, ConnActivities::CStartAttachActivity::TSetIdleIfStopOutstanding, MeshMachine::TErrorTag)
       
   152 
   149 	NODEACTIVITY_ENTRY(KErrorTag, CoreNetStates::TSendClientLeavingRequestToServiceProviders, MeshMachine::TAwaitingLeaveComplete, MeshMachine::TNoTag)
   153 	NODEACTIVITY_ENTRY(KErrorTag, CoreNetStates::TSendClientLeavingRequestToServiceProviders, MeshMachine::TAwaitingLeaveComplete, MeshMachine::TNoTag)
   150 	NODEACTIVITY_ENTRY(KNoTag, CoreNetStates::TSetIdleIfNoServiceProviders, MeshMachine::TAwaitingLeaveComplete, ConnectionCleanupActivities::TNoTagOrNoTagBackwards)
   154 	NODEACTIVITY_ENTRY(KNoTag, CoreNetStates::TSetIdleIfNoServiceProviders, MeshMachine::TAwaitingLeaveComplete, ConnectionCleanupActivities::TNoTagOrNoTagBackwards)
   151 	LAST_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TDoNothing)
   155 	LAST_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TDoNothing)
   152 NODEACTIVITY_END()
   156 NODEACTIVITY_END()
   153 }
   157 }
   192 	FIRST_NODEACTIVITY_ENTRY(SubSessStates::TAwaitingIPC<ECNStop>, MeshMachine::TNoTag)
   196 	FIRST_NODEACTIVITY_ENTRY(SubSessStates::TAwaitingIPC<ECNStop>, MeshMachine::TNoTag)
   193 	// NOTE: TAcquireMessageOwnership MUST occur before any blocking takes place, otherwise the Player will
   197 	// NOTE: TAcquireMessageOwnership MUST occur before any blocking takes place, otherwise the Player will
   194 	// complete the message upon return from the blocked activity.
   198 	// complete the message upon return from the blocked activity.
   195 	THROUGH_NODEACTIVITY_ENTRY(KNoTag, SubSessStates::TAcquireMessageOwnership, CoreNetStates::TActiveOrNoTagBlockedByGoneDown)
   199 	THROUGH_NODEACTIVITY_ENTRY(KNoTag, SubSessStates::TAcquireMessageOwnership, CoreNetStates::TActiveOrNoTagBlockedByGoneDown)
   196 	THROUGH_NODEACTIVITY_ENTRY(KActiveTag, ConnStates::TCancelStartOrAttachConnection, ConnStates::TNoTagOrNoBearerBlockedByStartOrAttach)
   200 	THROUGH_NODEACTIVITY_ENTRY(KActiveTag, ConnStates::TCancelStartOrAttachConnection, ConnStates::TNoTagOrNoBearerBlockedByStartOrAttach)
   197 	THROUGH_NODEACTIVITY_ENTRY(KNoTag, CoreNetStates::TCancelAndCloseZone0ClientExtIfaces, MeshMachine::TNoTag)
   201 	THROUGH_NODEACTIVITY_ENTRY(KNoTag, SubSessStates::TCancelAndCloseClientExtIfaces, MeshMachine::TNoTag)
   198     THROUGH_NODEACTIVITY_ENTRY(KNoTag, ConnStates::TCancelAllLegacyRMessage2Activities, ConnStates::TNoTagBlockedByLegacyRMessage2Activities)
   202     THROUGH_NODEACTIVITY_ENTRY(KNoTag, ConnStates::TCancelAllLegacyRMessage2Activities, ConnStates::TNoTagBlockedByLegacyRMessage2Activities)
   199 	NODEACTIVITY_ENTRY(KNoTag, ConnStates::TSendStopConnection, TECABState<CoreNetStates::TAwaitingStopped>, MeshMachine::TNoTag)
   203 	NODEACTIVITY_ENTRY(KNoTag, ConnStates::TSendStopConnection, TECABState<CoreNetStates::TAwaitingStopped>, MeshMachine::TNoTag)
   200     THROUGH_NODEACTIVITY_ENTRY(KNoTag, ConnStates::TGenerateConnectionDownProgress, MeshMachine::TNoTag)
   204     THROUGH_NODEACTIVITY_ENTRY(KNoTag, ConnStates::TGenerateConnectionDownProgress, MeshMachine::TNoTag)
   201 
   205 
   202 	NODEACTIVITY_ENTRY(KNoTag, CoreNetStates::TSendClientLeavingRequestToServiceProviders, MeshMachine::TAwaitingLeaveComplete, MeshMachine::TNoTag)
   206 	NODEACTIVITY_ENTRY(KNoTag, CoreNetStates::TSendClientLeavingRequestToServiceProviders, MeshMachine::TAwaitingLeaveComplete, MeshMachine::TNoTag)
   521 	// will need to be brought over
   525 	// will need to be brought over
   522 	iLastProgress = aExistingConnection.iLastProgress;
   526 	iLastProgress = aExistingConnection.iLastProgress;
   523 	iLastProgressError = aExistingConnection.iLastProgressError;
   527 	iLastProgressError = aExistingConnection.iLastProgressError;
   524 	iProgressQueue = aExistingConnection.iProgressQueue;
   528 	iProgressQueue = aExistingConnection.iProgressQueue;
   525 
   529 
   526 	/**
       
   527 	   The first commented in section of code here is incorrect. It only clones one of the service providers and not them
       
   528 	   all. This means that certain calls, GetIntSetting being one, does not work on cloned connections. Unfortunately,
       
   529 	   some code now relies on this being broken (browser). This code needs to be fixed before the first section of code
       
   530 	   is removed and the proper code reinstated.
       
   531 	*/
       
   532 #if 1   // BAD CODE
       
   533 	RNodeInterface* sp = aExistingConnection.ServiceProvider();
       
   534 	if (sp)
       
   535 		{
       
   536 	    AddClientL(sp->RecipientId(), TClientType(TCFClientType::EServProvider, TCFClientType::EActive));
       
   537 
       
   538 		// TODO IK: This is the wrong message to be using here, should use JoinRequest/Complete handshake
       
   539 	    sp->PostMessage(Id(), TCFFactory::TPeerFoundOrCreated(Id(), 0).CRef());
       
   540         }
       
   541 	else
       
   542 		{
       
   543 		LOG( ESockLog::Printf(KESockConnectionTag, _L8("CConnection %08x CloneL KErrNotReady"), this) );
       
   544 		User::Leave(KErrNotReady);
       
   545 		}
       
   546 
       
   547 #else   // PROPER CODE
       
   548 	/*
   530 	/*
   549 	  This function looks like it'd be better to do in one loop. dont do this though. All fallible parts need to be done before
   531 	  This function looks like it'd be better to do in one loop. dont do this though. All fallible parts need to be done before
   550 	  sending the messages to ourselves, otherwise the mesh machine will panic.
   532 	  sending the messages to ourselves, otherwise the mesh machine will panic.
   551 	*/
   533 	*/
   552 	TInt numSP = 0;
   534 	TInt numSP = 0;
   593 			// TODO IK: This is the wrong message to be using here, should use JoinRequest/Complete handshake
   575 			// TODO IK: This is the wrong message to be using here, should use JoinRequest/Complete handshake
   594 			sp->PostMessage(Id(), TCFFactory::TPeerFoundOrCreated(Id(), 0).CRef());
   576 			sp->PostMessage(Id(), TCFFactory::TPeerFoundOrCreated(Id(), 0).CRef());
   595 			sp = iter++;
   577 			sp = iter++;
   596 			}
   578 			}
   597 		}
   579 		}
   598 #endif
       
   599 	}
   580 	}
   600 
   581 
   601 
   582 
   602 RNodeInterface* CConnection::DefaultSubConnectionServiceProvider()
   583 RNodeInterface* CConnection::DefaultSubConnectionServiceProvider()
   603  	{
   584  	{