Synchronous I/O Multiplexing With Select - HP Rp3440-4 - 9000 - 0 MB RAM Programmer's Manual

Bsd sockets interface programmer’s guide
Hide thumbs Also See for Rp3440-4 - 9000 - 0 MB RAM:
Table of Contents

Advertisement

Advanced Topics for Internet Datagram Sockets

Synchronous I/O Multiplexing with Select

Synchronous I/O Multiplexing with
Select
The select system call can be used with sockets to provide a
synchronous multiplexing mechanism. The system call has several
parameters which govern its behavior. If you specify a zero pointer for
the timeout parameter timout, select will block until one or more of
the specified socket descriptors is ready. If timout is a non-zero pointer,
it specifies a maximum interval to wait for the selection to complete.
select is useful for datagram socket descriptors to determine when
data have arrived and are ready to be read without blocking; use the
FIONREAD parameter to the ioctl system call to determine exactly
how much data are available.
select for exceptional conditions will return true for BSD sockets if
out-of- band data is available. select will always return true for sockets
which are no longer capable of being used (e.g. if a close or shutdown
system call has been executed against them).
select is used in the same way as in other applications. Refer to the
select(2) man page for information on how to use select.
114
Chapter 5

Advertisement

Table of Contents
loading

Table of Contents