Re: Offtopic: Some programming questions (solved)

Hans de Goede (j.w.r.degoede@ITS.tudelft.nl)
Fri, 23 Oct 1998 13:30:01 +0200


Pete Chown wrote:
>
> Hans de Goede wrote:
>
> > I want todo a blockingread on a connectionless socket, with a timeout
> > of letts say 5 seconds.
>
> First alternative: use alarm() to set a timeout, then do your read() as
> normal.
>
> Second alternative: use pthread_create() to spawn a new thread and do
> the read in that thread. Then the parent thread cancels it if the five
> seconds is exceeded.
>
> Third alternative: set asynchronous IO on the socket.
>
> Fourth alternative: change the kernel so that select responds to data on
> connectionless sockets. (I thought this was the correct behaviour.) If
> you do this we will even let you post on linux-kernel again... :-)
>
It already does, I made a big boe boe.
Apologies to all for the offtopic posting and my stupidity ;)

Regards,

Hans

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/