Why my Active Object is Working?
| Fri, 2008-07-11 09:23 | |
|
|
According to AO pattern: I Changed my order like 1->3->2 and found that its working fine in below scenarios: My Active Object Class: CMyHandlerAO * CMyHandlerAO::NewL()Senario 1: TInt RMySrv::Connect()Its working fine. Scenario 2:: void RMySrv::SetData()Its working fine. Scenario 3: TInt RMySrv::Connect()Its not working i am getting stray signal in connect() (as expected). Can anyone tell me why its working fine in scenario 1 and 2 but not in scenario 3. |






Forum posts: 121
Try ensuring that SetActive is called after you've invoked your async call.
When SetActive() is set to true, and iStatus does not equal KRequestPending, then the active scheduler will invoke the RunL() since the Active Scheduler will think your active object has had it's request serviced.
After:
TInt RMySrv::Connect(){
…………………………
…………………………
iCMyHandlerAO1 = CMyHandlerAO::NewL();
return CreateSession(KMyServerName,CMyServer::Version(),
KDefaultMessageSlots);
}
iStatus = 0 (zero into of CBase class)
iActive = True
If createSession causes the active scheduler to run through it's loop, then the CMyHandlerAO::RunL() will be called and the iActive set to False.
iStatus = 0
iActive = False
void RMySrv::SetData(){
……………………….
……………………….
sendrecieve(iCMyHandlerAO1-> Status(),payloadData);
...............................
}
Result : Stray signal.