From: James Y K. <fo...@fu...> - 2007-03-27 22:58:13
|
On Mar 27, 2007, at 8:42 AM, Brian Mastenbrook wrote: > I think the interface which is needed here is: > > * A function to return the current deadline based on the current > timer queue, > * A function to trigger appropriate timeout actions when the > deadline > has passed, > * A function to register a timeout, which is given an instance of a > condition class to be signaled when the timeout expires > * A function to cancel a timeout, which is given the condition > class > instance to find in the queue and cancel > Uggg. This sounds really overdesigned to me. What I'd like is simple: timer support in the serve-event loop. I think that should cleanly cover your UDP SIP server case as well. Other than that, a timeout argument to various blocking functions is useful, but I don't really see that they need such a sophisticated support system to go along with them. One can always keep a global variable *deadline* in user code and pass the appropriate timeout to each function as you call it, no? An implicit failure-inducing global like that just seems dangerous. James |