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?
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.