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

166 lines
4.5 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>send_file64()--Send a File over a Socket Connection</title>
<!-- 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. -->
<!-- Begin Header Records ========================================== -->
<!-- Unix8 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!--End Header Records -->
<!-- Edited by Kersten Feb 02 -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="Top_Of_Page"></a>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<h2>send_file64()--Send a File over a Socket Connection</h2>
<div class="box" style="width: 50%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;sys/types.h&gt;
#include &lt;sys/socket.h&gt;
int send_file64(int *<em>socket_descriptor</em>,
struct sf_parms64 *<em>sf_struct</em>,
int <em>flags</em>)
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QSOSRV1<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Conditional; see <a href="#USAGE_NOTES">Usage Notes</a>.<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <em>send_file64()</em> function is used to send the contents of an open
file over an existing socket connection.</p>
<p>The <em>send_file64()</em> API is a combination of the IFS <em>read()</em>
and the sockets <em>send()</em> and <em>close()</em> APIs. Socket applications
that transmit a file over a socket connection can, under certain circumstances,
obtain improved performance by using <em>send_file64()</em>.</p>
<p><em>send_file64()</em> is enabled for large files. It is capable of
operating on files larger than 2 GB minus 1 byte. For additional information on
the parameters, authorities required, return values, error conditions, error
messages, and other usage notes, see <a href="send.htm">send_file()--Send a
File over a Socket Connection</a>.</p>
<h3>Parameters</h3>
<dl>
<dt><strong>socket_descriptor</strong></dt>
<dd>(Input/Output) A pointer to the socket descriptor that is to be written
to.<br>
<br>
</dd>
<dt><strong>sf_struct</strong></dt>
<dd>(Input/Output) A pointer to the send_file64 structure that contains the
following:<br>
<br>
<ul>
<li>The header buffer and length.<br>
<br>
</li>
<li>The file descriptor, the offset into the file, the file size, and the
number of bytes to send from the file.<br>
<br>
</li>
<li>The trailer buffer and length.<br>
<br>
</li>
<li>The number of bytes of data that were sent.</li>
</ul>
<p>The structure pointed to by the <em>sf_struct</em> parameter is defined in
<strong>&lt;sys/socket.h&gt;</strong>.</p>
<pre>
struct sf_parms64
{
void *header_data;
size_t header_length;
int file_descriptor;
unsigned long long file_size;
long long file_offset;
long long file_bytes;
void *trailer_data;
size_t trailer_length;
unsigned long long bytes_sent;
}
</pre>
<br>
<br>
</dd>
<dt><strong>flags</strong></dt>
<dd>(Input) A flag value that controls what is done with the socket connection
after the data has been transmitted.</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>No authorization is required.</p>
<br>
<h3><a name="USAGE_NOTES">Usage Notes</a></h3>
<ol>
<li>When you develop in C-based languages, the prototypes for the 64-bit APIs
are normally hidden. To use the <em>send_file64()</em> API, you must compile
the source with the _LARGE_FILE_API macro defined.<br>
<br>
</li>
<li>All of the Usage Notes for <em>send_file()</em> apply to
<em>send_file64()</em>. See <a href="send.htm#HDRSDFUSAG">Usage Notes</a> in
the <em>send_file()</em> API.</li>
</ol>
<br>
<hr>
API introduced: V4R4
<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>