ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzab6_5.4.0.1/cmultiplex.htm

59 lines
4.0 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="I/O multiplexing—select()" />
<meta name="abstract" content="Because asynchronous I/O provides a more efficient way to maximize your application resources, it is recommended that you use asynchronous I/O APIs rather than the select() API. However, your specific application design may allow select() to be used." />
<meta name="description" content="Because asynchronous I/O provides a more efficient way to maximize your application resources, it is recommended that you use asynchronous I/O APIs rather than the select() API. However, your specific application design may allow select() to be used." />
<meta name="DC.Relation" scheme="URI" content="aconcepts.htm" />
<meta name="DC.Relation" scheme="URI" content="xnonblock.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="cmultiplex" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>I/O multiplexing—select()</title>
</head>
<body id="cmultiplex"><a name="cmultiplex"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">I/O multiplexing—<span class="apiname">select()</span></h1>
<div><p>Because asynchronous I/O provides a more efficient way to maximize
your application resources, it is recommended that you use asynchronous I/O
APIs rather than the <span class="apiname">select()</span> API. However, your specific
application design may allow <span class="apiname">select()</span> to be used.</p>
<p>Like asynchronous I/O, the <span class="apiname">select()</span> function
creates a common point to wait for multiple conditions at the same time. However, <span class="apiname">select()</span> allows
an application to specify sets of descriptors to see if the following conditions
exist: </p>
<ul><li>There is data to be read.</li>
<li>Data can be written.</li>
<li>An exception condition is present.</li>
</ul>
<p>The descriptors that can be specified in each set can be socket descriptors,
file descriptors, or any other object that is represented by a descriptor.</p>
<p>The <span class="apiname">select()</span> function also allows the application to
specify if it wants to wait for data to become available. The application
can specify how long to wait. </p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="aconcepts.htm" title="Advanced socket concepts go beyond a general discussion of what sockets are and how they work. They provide ways to design socket applications for larger and more complex networks.">Advanced socket concepts</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="xnonblock.htm" title="This sample program uses nonblocking and the select() API.">Example: Nonblocking I/O and select()</a></div>
</div>
</div>
</body>
</html>