Hi Lucian,
I solved my problem. It was a stupid mistake.
iSocket.RecvOneOrMore(str, 0, iStatus, aLen);
User::WaitForRequest(ilStatus); // I should wait for iStatus, not
ilStatus :)
I needed a blocking "receive data" method because I use it in a framework.
The problem now is that I'm trying to implement a timed-out receive
method.
First time I tried like this:
iSocket.RecvOneOrMore(str, 0, iStatus, aLen);
TRequestStatus iTimeStatus;
RTimer iTimer;
iTimer.CreateLocal(); // created for this thread
iTimer.After(iTimeStatus, 10 * MICRO_PER_SEC); // Notification after 10
seconds
User::WaitForRequest(iTimeStatus, iStatus);
iTimer.Cancel();
if(iTimeStatus == KErrNone)
{
//we have a timed-out
}
The application is crashing because of the RTimer.
The second method was to use a CPeriod like this:
iRecvTimer->Start(10000000, 1 * 10000000000, TCallBack(RecvTimerCallBack,
this));
and in callback function something like this:
TRequestStatus* p = &pProcessor->iStatus;
RThread().RequestComplete(p, KErrNone);
.... but again the application is crashing.
Any ideas?
Thank you.
Cristian Miron


|