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

321 lines
8.2 KiB
HTML

<!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>clnt_control()--Change Information about a Client Object</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 -->
<!-- RPCMST SCRIPT A converted by B2H R4.1 (346) (CMS) by PMHALL at -->
<!-- RCHVMW2 on 7 Oct 1998 at 23:43:14 -->
<!--File Edited April 2001 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!--Java sync-link-->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<h2>clnt_control()--Change Information about a Client Object</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax<br>
<!-- iddvc RMBR -->
<br>
<pre>
#include &lt;rpc/rpc.h&gt;
bool_t clnt_control(CLIENT *<em>clnt</em>,
const u_int <em>req</em>,
char *<em>info</em>);
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QZNFTRPC<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: No<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>clnt_control()</strong> function is used to change or retrieve
information about a client object. For both connectionless and
connection-oriented transports, the supported values for <em>req</em>, their
argument types, and what they do follow:</p>
<table border width="80%" cellpadding="5">
<tr>
<th align="left" valign="top">Values for the req Parameter</th>
<th align="left" valign="top">Argument Type</th>
<th align="left" valign="top">Function</th>
</tr>
<tr>
<td align="left" valign="top" width="25%">CLSET_TIMEOUT</td>
<td align="left" valign="top" width="25">(struct timeval *)</td>
<td align="left" valign="top" width="50%">Set total time out</td>
</tr>
<tr>
<td align="left" valign="top">CLGET_TIMEOUT</td>
<td align="left" valign="top">(struct timeval *)</td>
<td align="left" valign="top">Get total time out</td>
</tr>
<tr>
<td align="left" valign="top">CLGET_SERVER_ADDR</td>
<td align="left" valign="top">(struct netbuf *)</td>
<td align="left" valign="top">Get server's address</td>
</tr>
<tr>
<td align="left" valign="top">CLGET_SVC_ADDR</td>
<td align="left" valign="top">(struct netbuf *)</td>
<td align="left" valign="top">Get server's address</td>
</tr>
<tr>
<td align="left" valign="top">CLSET_SVC_ADDR</td>
<td align="left" valign="top">(struct netbuf *)</td>
<td align="left" valign="top">Set to new address</td>
</tr>
<tr>
<td align="left" valign="top">CLGET_FD</td>
<td align="left" valign="top">(int *)</td>
<td align="left" valign="top">Get the associated file descriptor</td>
</tr>
<tr>
<td align="left" valign="top">CLSET_FD_CLOSE</td>
<td align="left" valign="top">(void)</td>
<td align="left" valign="top">Close the file descriptor when the API destroys
the client handle</td>
</tr>
<tr>
<td align="left" valign="top">CLSET_FD_NCLOSE</td>
<td align="left" valign="top">(void)</td>
<td align="left" valign="top">Do not close the file descriptor when the API
destroys the client handle</td>
</tr>
<tr>
<td align="left" valign="top">CLGET_VERS</td>
<td align="left" valign="top">(unsigned long *)</td>
<td align="left" valign="top">Get the RPC program's version number that is
associated with the client handle</td>
</tr>
<tr>
<td align="left" valign="top">CLSET_VERS</td>
<td align="left" valign="top">(unsigned long *)</td>
<td align="left" valign="top">Set the RPC program's version number that is
associated with the client handle</td>
</tr>
<tr>
<td align="left" valign="top">CLGET_PROG</td>
<td align="left" valign="top">(unsigned long *)</td>
<td align="left" valign="top">Get the program number</td>
</tr>
<tr>
<td align="left" valign="top">CLSET_PROG</td>
<td align="left" valign="top">(unsigned long *)</td>
<td align="left" valign="top">Set the program number</td>
</tr>
<tr>
<td align="left" valign="top">CLGET_XID</td>
<td align="left" valign="top">(unsigned long *)</td>
<td align="left" valign="top">Get the XID of the previous RPC</td>
</tr>
<tr>
<td align="left" valign="top">CLSET_XID</td>
<td align="left" valign="top">(unsigned long *)</td>
<td align="left" valign="top">Set the XID of the next RPC</td>
</tr>
<tr>
<td align="left" valign="top">CLSET_RETRY_TIMEOUT<sup>1</sup></td>
<td align="left" valign="top">(struct timeval *)</td>
<td align="left" valign="top">Set the retry time-out</td>
</tr>
<tr>
<td align="left" valign="top">CLGET_RETRY_TIMEOUT<sup>1</sup></td>
<td align="left" valign="top">(struct timeval *)</td>
<td align="left" valign="top">Get the retry time-out</td>
</tr>
<tr>
<td align="left" valign="top" colspan="3"><strong>Note:</strong> <br>
<em>1</em>&nbsp;&nbsp;&nbsp;Valid only for connectionless transports.</td>
</tr>
</table>
<br>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>clnt</strong> &nbsp;(Input)&nbsp;</dt>
<dd>A pointer to the client handle structure.<br>
<br>
</dd>
<dt><strong>req</strong> &nbsp;(Input)&nbsp;</dt>
<dd>The type of operation.<br>
<br>
</dd>
<dt><strong>info</strong> &nbsp;(Input/Output)&nbsp;</dt>
<dd>A pointer to the information for request type. The <em>info</em> parameter
is expected to be a pointer to an appropriate structure. The nature of the
structure depends on the <em>req</em> parameter.</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>No authorization is required.</p>
<br>
<h3>Return Value</h3>
<table cellpadding="5">
<!-- cols="15 85" -->
<tr>
<td align="left" valign="top"><em>TRUE (1)</em></td>
<td align="left" valign="top">Successful</td>
</tr>
<tr>
<td align="left" valign="top"><em>FALSE (0)</em></td>
<td align="left" valign="top">Unsuccessful</td>
</tr>
</table>
<br>
<br>
<h3>Error Conditions</h3>
<p>Failure is returned only when a bad format of parameters is detected. For
example, the <em>info</em> parameter is NULL, when a pointer to a timeval
structure is expected.</p>
<br>
<h3>Error Messages</h3>
<table width="100%">
<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">CPIA1B1 I</td>
<td width="85%" valign="top">A problem was encountered in the RPC client.</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">CPF3CF2 E</td>
<td align="left" valign="top">Error(s) occurred during running of &amp;1
API.</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>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<p>The following example shows how <strong>clnt_control()</strong> is used:</p>
<pre>
#include &lt;rpc/rpc.h&gt;
main()
{
CLIENT *clnt;
int fd;
...
/* Get the associated file descriptor */
<strong>clnt_control</strong>(clnt, CLGET_FD, (int *)&amp;fd);
...
}
</pre>
<br>
<h5>Notes</h5>
<ol>
<li>If the time-out is set using the <strong>clnt_control()</strong> API, the
<em>timeout</em> parameter passed to the <strong>clnt_call()</strong> API will
be ignored in all future calls.<br>
</li>
<li>The retry time-out is the time that the connectionless RPC client waits for
the server to reply before retransmitting the request.</li>
</ol>
<br>
<hr>
API introduced: V4R2
<hr>
<table cellpadding="2" cellspacing="2" align="center">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"rpc1.htm">Remote Procedure Call (RPC) APIs</a> | <a href="aplist.htm">APIs by
category</a></td>
</tr>
</table>
</body>
</html>