26.7 Mutexes: Mutual Exclusion


25.4 Summary

Signal-driven I/O has the kernel notify us with the SIGIO signal when "something" happens on a socket.

  • With a connected TCP socket, numerous conditions can cause this notification, making this feature of little use.

  • With a listening TCP socket, this notification occurs when a new connection is ready to be accepted.

  • With UDP, this notification means either a datagram has arrived or an asynchronous error has arrived; in both cases, we call recvfrom .

We modified our UDP echo server to use signal-driven I/O, using a technique similar to that used by NTP: read a datagram as soon as possible after it arrives to obtain an accurate timestamp for its arrival and then queue it for later processing.



UNIX Network Programming Volume 1, Third Edition
Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
ISBN: 0131411551
EAN: 2147483647
Year: 2003
Pages: 441

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net