Timers & socket select
- From: InuY4sha <riccardomanfrin@xxxxxxxxx>
- Date: Fri, 27 Jul 2007 10:14:24 -0000
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
.
- Follow-Ups:
- Re: Timers & socket select
- From: Andrei Voropaev
- Re: Timers & socket select
- From: Robert Harris
- Re: Timers & socket select
- Prev by Date: Re: Cross platform pointer to program text area?
- Next by Date: Re: Can't undate running process binary in Solaris?
- Previous by thread: Modifying telnet
- Next by thread: Re: Timers & socket select
- Index(es):
Relevant Pages
|