I have a problem with my timer which is supposed to control a connection attempt.
It is started with a timeout of 50 seconds when a connection attempt is called by a RSocket object (RSocket::Connect()). On expiration it is supposed to initiate the cancellation of the connection attempt by invoking the necessary code in the Timer's RunL() method. If the socket gets connected earlier, the Timer is cancelled (CTimer::Cancel).
However, the Timer seems to expire too early. The connection is established, and right after the timer expires. The RunL() method of the object owning the RSocket object is not even called (to confirm the succesful connection attempt).
Can anybody please explain me WHEN the CTime::RunL() method is called? Only on expiration of the timer, or sometime else as well?
Otherwise
Do you have socket connection and the timer in the same class. You maybe passing the same TRequestStatus to both request providers. (timer and socketserver)
So the setting of the TRequestStatus = KErrNone from the socket server is causing your timer runl to be called aswell
This just a guess.
Rich
Last edited by ricardo_hotton; 2004-08-13 at 12:38.
what kind of timer? Remember that there are also periodic timers and in that case you can set 2 values: when the first "tick" should occur and period...
Re: Problem with connection timeout
2006-09-21, 20:12#4
I have a different problem with this exact same scenario. When the connection is established, I cancel the CTimer. However, it takes 20-25 seconds for the Cancel method to run, which screws up the rest of my program. I have no idea why it takes so long to run Cancel.