Timers & socket select



Hi,
I've some sockets handled through a select() implemented this way:
/********************************************/
int main(){
......
fd_set pippo;
.....
while(1){
select(maxval+1, &pippo, NULL, NULL, NULL);
if(FD_ISSET(...){
do_this();
if(FD_ISSET(...){
do_that();
}
}
return 0;
}
/********************************************/

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.
I saw some functions like alarm, setitimer, getitimer but I don't know
the usage.. and also I don't know what happens when for instance the
socket receives something and the select triggers it to be read (and
some actions to be performed) while at the same time the timer
expires... who as the right to proceed... is the expiration signal put
to wait until the reading from the select (and following actions)
is(are) done ?

I hope you got what I'm tring to say...
Thanks in advance

RM

.



Relevant Pages

  • Re: Timers & socket select
    ... select(maxval+1, &pippo, NULL, NULL, NULL); ... The sockets are the stdin and some ipc sockets... ... to to setup a timer somewhere in that code to handle a synchronous ... asynchronous readings. ...
    (comp.lang.c)
  • Re: Timers & socket select
    ... select(maxval+1, &pippo, NULL, NULL, NULL); ... The sockets are the stdin and some ipc sockets... ... to to setup a timer somewhere in that code to handle a synchronous ... asynchronous readings. ...
    (comp.unix.programmer)
  • Timers & socket select
    ... select(maxval+1, &pippo, NULL, NULL, NULL); ... The sockets are the stdin and some ipc sockets... ... to to setup a timer somewhere in that code to handle a synchronous ... asynchronous readings. ...
    (comp.unix.programmer)
  • Re: I have the same annoying garage door opener problem
    ... sockets on both sides of it. ... The light bulbs are supposed to come on ... I opened it up and found the timer that turns on the lights is a bi-metalic strip with a heater wire wound around it. ...
    (alt.home.repair)
  • Re: Timeout on Async Receive
    ... would help eliminate race conditions with sockets being destroyed ... while processed for timeout. ... Is the response that you're waiting for generated by machine or by ... I've tended to prefer a per socket timer system where the only ...
    (microsoft.public.win32.programmer.networks)