Re: sockets and signals

From: Glynn Clements (glynn@sensei.co.uk)
Date: Thu Feb 10 2000 - 03:43:45 EST


Greg wrote:

> Would I be right in thinking that you can setup a signal handler for
> notification of received data on a non blocking socket ?
> And could you do something similar for a character device ?

If you enable async I/O, with:

        int one = 1;

        if (ioctl(fd, FIOASYNC, &one) < 0)
        {
                perror("ioctl(FIOASCYNC)");
                return 1;
        }

you will receive SIGIO whenever there is data available.

-- 
Glynn Clements <glynn@sensei.co.uk>

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.rutgers.edu



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:35 EST