Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Codewarrior Symbian > Re: RecvOneOrMo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 95 of 155
Post > Topic >>

Re: RecvOneOrMore unknown error

by cris_miron@[EMAIL PROTECTED] (Cristian Miron) Oct 21, 2004 at 04:01 AM

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




 4 Posts in Topic:
RecvOneOrMore unknown error
cris_miron@[EMAIL PROTECT  2004-09-23 03:01:28 
Re: RecvOneOrMore unknown error
MW Ron <mwron@[EMAIL P  2004-10-01 15:09:09 
Re: RecvOneOrMore unknown error
"Lucian Tomuta"  2004-10-13 15:09:05 
Re: RecvOneOrMore unknown error
cris_miron@[EMAIL PROTECT  2004-10-21 04:01:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 3:16:06 CDT 2008.