This version, which uses WaitForRequest(), works like a charm. However since it is handled serially and introduces an unacceptable delay in the code, it is necessary that I be able to use the signalling mechanism so that other functions can be called while I am downloading data.
It is a little strange to me for your two piece of code. First of all, are you using CActive class in your design? If yes, you have to use "iStatus" which is a member of CActive class.
For your information, if you use RSocket.Recv(TDes8& aDesc,TUint flags,TRequestStatus& aStatus), only the descriptor is fully filled, then your RunL will get run. If you want to get your RunL() to run whenever there is a byte coming in, you may use the following API:
To clarify, in the first version, I'm using a class inherited from the CTimer class, which according to the API inherits from CActive. I did try inheriting from CActive as well before, with the same non-responsive results. In the course of testing out some other ideas, I switched it to CTimer instead. I am also using iStatus, in the first piece of code. The second one works fine whether I use iStatus or my own local function variable iStat.
I do know that RunL only gets called when the descriptor gets filled, but I do not receive any response even after many minutes of waiting. And I know that the data should have been received sooner, based on the experience with the second version of the code, which I had working before. That one uses User::WaitForRequest and works quite fine.
So what I've got is the second code that does receive data and handles it properly, but effectively suspends the entire program when User::WaitForRequest is called while it waits for the descriptor to be filled and Recv() to return. And then there is the first code that doesn't seem to receive any data at all, or at least RunL is never called even after enough time has passed to fill the descriptor completely.
Do you or anyone else have a piece of code that does work using Recv() and not RecvOneOrMore()? Most of the API documentation uses RecvOneOrMore() as an example, and I'd like to see a code in action that works using Recv(). I've already tried using the Echo example as a model, but that doesn't seem to be working, so another example would be quite helpful.