Hi,
I am confused if observers are asynchronous or not. Bellow is code snippet to explain what I mean:
CSocketReader is Active object which reads data from the socket.
...
CSocketReader::ReadData() {
...
SetActive();
}
CSocketReader::RunL() {
...
iObserver.NotifyChanges(iBuffer);
iBuffer.Zero();
}
...
CEngine has instance of CSocketReader and starts socket reading
...
CEngine::Start() {
iSocketReader->ReadData();
}
// Callback function which is called when
// CSocketReader reads data from the socket
CEngine::NotifyChanges(TDes& aBuffer){
...
ProcessData(aBuffer);
iSocketReader->ReadData(); // read data from the socket again
}
So, my question is: when iBuffer.Zero() is executed? Before calling ProcessData(aBuffer) or after?
I hope you understand what I mean.
Thank you

Reply With Quote


