Callback Timer function in C++

Posted by user3596609 on Stack Overflow See other posts from Stack Overflow or by user3596609
Published on 2014-08-18T16:02:13Z Indexed on 2014/08/18 16:21 UTC
Read the original article Hit count: 139

Filed under:
|
|

I am trying to implement a callback timer function in C++ which should do a callback after a timeout. I am listening on a socket and then waiting for messages on it. so if I have something like getMessages() and I want to pass the timer function in it as an argument. So how can it be implemented that after the receive of a message, the timer is started and the callback happens if there is a timeout before the next messages arrives.

I am new to callback functions. Any help is greatly appreciated. Thanks!

© Stack Overflow or respective owner

Related posts about c++

Related posts about timer