Re: Timers & socket select
- From: Andrei Voropaev <avorop@xxxxxxx>
- Date: Fri, 27 Jul 2007 14:14:58 +0000 (UTC)
On 2007-07-27, InuY4sha <riccardomanfrin@xxxxxxxxx> wrote:
[...]
The sockets are the stdin and some ipc sockets... what I would need is[...]
to to setup a timer somewhere in that code to handle a synchronous
action to perform while the select of course is still handling the
asynchronous readings.
Usually one would use the time-out variable for select and then just
track how much time really elapsed. Normally you'll end up outside of
select either because of some activity on the socket or because the
time-out expired. Before entering select you shall figure out how much
time is left till your synchronious event and set the select time-out.
Better yet, there are libraries out there that allow you to handle
multiple timed events at the same time. Plus provide easier interface to
select. Google for libevent for example.
--
Minds, like parachutes, function best when open
.
- Follow-Ups:
- Re: Timers & socket select
- From: InuY4sha
- Re: Timers & socket select
- From: Rainer Weikusat
- Re: Timers & socket select
- References:
- Timers & socket select
- From: InuY4sha
- Timers & socket select
- Prev by Date: Re: Timers & socket select
- Next by Date: Re: Timers & socket select
- Previous by thread: Re: Timers & socket select
- Next by thread: Re: Timers & socket select
- Index(es):