ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/postiocompletion.htm

355 lines
8.6 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>QsoPostIOCompletion()--Post I/O Completion Request</title>
<!-- Begin Header Records -->
<!-- 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. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Created for V5R1 -->
<!-- Edited by Kersten Feb 02 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!--Java sync-link-->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>QsoPostIOCompletion()--Post I/O Completion Request</h2>
<div class="box" style="width: 80%;">
<br>
&nbsp;&nbsp;Syntax
<pre>
#include &lt;qsoasync.h&gt;
int QsoPostIOCompletion
(int IOCompletionPort, Qso_OverlappedIO_t * communicationsArea)
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QSOSRV3<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The QsoPostIOCompletion function will post an Qso_OverlappedIO_t request on
a specifed I/O completion port. This allows an application to notify a
completion port that some function or activity has occurred. The application
defines what that function or activity is within the Qso_OverlappedIO_t
request.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>int IOCompletionPort</strong> (Input)</dt>
<dd>The I/O completion port that should be posted.<br>
<br>
</dd>
<dt><strong>Qso_OverlappedIO_t</strong> * communicationsArea
(Input/Output)</dt>
<dd>A pointer to a structure that contains the following information:<br>
<br>
<table cellpadding="5">
<!-- cols="25 75" -->
<tr>
<td align="left" valign="top"><em>descriptorHandle</em></td>
<td align="left" valign="top">(Input) - The descriptor handle is
application-specific and is never used by the system. It is intended to make it
easier for the application to keep track of information regarding a given
socket connection.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>buffer</em></td>
<td align="left" valign="top">(Input) - Supplied value is preserved.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>bufferLength</em></td>
<td align="left" valign="top">(Input) - Supplied value is preserved.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>postFlag</em></td>
<td align="left" valign="top">(Input) - Supplied value is preserved.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>fillBuffer</em></td>
<td align="left" valign="top">(Input) - Supplied value is preserved.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>returnValue</em></td>
<td align="left" valign="top">(Output) - This field will be set to 0 if this
operation completes successfully.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>errnoValue</em></td>
<td align="left" valign="top">(Output) - This field will be set to 0 if this
operation completes successfully.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>operationCompleted</em></td>
<td align="left" valign="top">(Output) - This field is updated to
QSOPOSTIOCOMPLETION.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>secureDataTransferSize</em></td>
<td align="left" valign="top">Not used.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>bytesAvailable</em></td>
<td align="left" valign="top">Not used.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>operationWaitTime</em></td>
<td align="left" valign="top">(Input) - A timeval structure which specifies a
time to wait before posting this operation asynchronously to the I/O completion
port with <em>errnoValue</em> set to EAGAIN.
<pre>
struct timeval {
long tv_sec; /* second */
long tv_usec; /* microseconds */
};
</pre>
If this field is set to zero, the operation will be posted immediately.<br>
<br>
If <em>postedDescriptor</em> is closed before the timer expires, the operation
will be posted to the I/O completion port with <em>errnoValue</em> set to
ECLOSED.<br>
<br>
The minimum operationWaitTime is 1 second. The microseconds field (tv_usec) in
the timeval is not used and must be set to zero.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>postedDescriptor</em></td>
<td align="left" valign="top">This field is only relevant if a non-zero timeval
was specified in <em>operationWaitTime</em>. This is the socket descriptor to
be associated with the timer. If this descriptor is closed before the timer
expires, the operation will be posted to the I/O completion port with
<em>errnoValue</em> set to ECLOSED.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>reserved1</em></td>
<td align="left" valign="top">(Input) - Must be set to hex zeroes.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>reserved2</em></td>
<td align="left" valign="top">(Input) - Must be set to hex zeroes.</td>
</tr>
</table>
</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>No authorization is required.</p>
<br>
<h3>Return Values</h3>
<p>QsoPostIOCompletion() returns an integer. Possible values are:</p>
<ul>
<li>-1 - The function did not complete because an error occurred. Inspect the
<strong>errno</strong> value to determine the cause of the failure.</li>
<li>0 - The function has successfully posted the communications area to the I/O
completion port.</li>
<li> 1 - The timer has been
started. When the timer expires the Qso_OverlappedIO_t communications structure
will be updated with the results and the I/O completion port will be posted.
</li>
</ul>
<br>
<h3>Errno Conditions</h3>
<p>When QsoPostIOCompletion() fails, errno can be set to one of the
following:</p>
<table cellpadding="5">
<!-- cols="15 85" -->
<tr>
<td align="left" valign="top"><em>[EINVAL]</em></td>
<td align="left" valign="top">The I/O completion port or a reserved field was
specified that was not valid or
operationWaitTime.tv_sec was negative or operationWaitTime.tv_usec was not
zero. <br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[EDESTROYED]</em></td>
<td align="left" valign="top">The I/O completion port has been destroyed.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[ENOBUFS]</em></td>
<td align="left" valign="top">There was not enough buffer space for the
requested operation. Check the maximum allowed storage for the executing user
profile.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[ENOMEM]</em></td>
<td align="left" valign="top">The I/O completion port is full and cannot accept
any more messages at this time.</td>
</tr>
</table>
<br>
<br>
<h3>Error Messages</h3>
<table width="100%" cellpadding="5">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top">Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td width="15%" valign="top">CPFA081 E</td>
<td width="85%" valign="top">Unable to set return value or error code.</td>
</tr>
<tr>
<td align="left" valign="top">CPE3418 E</td>
<td align="left" valign="top">Possible APAR condition or hardware failure.</td>
</tr>
<tr>
<td align="left" valign="top">CPF9872 E</td>
<td align="left" valign="top">Program or service program &amp;1 in library
&amp;2 ended. Reason code &amp;3.</td>
</tr>
</table>
<br>
<br>
<h3>Related Information</h3>
<ul>
<li><a href="createiocompletionport.htm">QsoCreateIOCompletionPort()</a>--Create
I/O Completion Port<br>
<br>
</li>
<li><a href="destroyiocompletionport.htm">QsoDestroyIOCompletionPort()</a>--Destroy
I/O Completion Port<br>
<br>
</li>
<li><a href="startrecv.htm">QsoStartRecv</a>--Start Asynchronous Recv
Operation<br>
<br>
</li>
<li><a href="startsend.htm">QsoStartSend</a>--Start Asynchronous Send
Operation<br>
<br>
</li>
<li><a href="waitforiocompletion.htm">QsoWaitForIOCompletion()</a>--Wait for I/O
Completion Operation</li>
</ul>
<br>
<hr>
API introduced: V5R1
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> |
<a href="unix.htm">UNIX-Type APIs</a> |
<a href="aplist.htm">APIs by category</a> </td>
</tr>
</table>
</center>
</body>
</html>