tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Writing to multiple descriptors with one system call

On Wed, 17 Mar 2010 16:01:28 +0000
Quentin Garnier <> wrote:

> Do you have a real world use for that?  For instance, I wouldn't call
> a web server that sends the same data to all its clients *at the same
> time* realistic.
Why? Because it never happens? I think it happens quite often. Another
example is a server that is sending live data, i.e. audio playback,
video stream, etc. If you can't use multicasting over a WAN, then you
have a situation where you are streaming the same data to large number
of clients.

> What do you do when you get EIO for the first fd, EPIPE for the
> second, EFBIG for the third, EINTR for the fourth and an undefined
> return status for the 4996 that follow?  (I guess on a socket you
> might only get EIO, ENOSPC and EINTR, but you get the idea.)
There are ways to make it work. You could have an errno as part of each
file descriptor structure and set it accordingly. But then most of the
time errors would not occur unless something went really wrong.

Home | Main Index | Thread Index | Old Index