📄 t_rcvv.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>t_rcvv</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4>NAME</h4><blockquote>t_rcvv - receive data or expedited data sent over aconnection and put the data into one or more non-contiguous buffers</blockquote><h4>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="xti.h.html">xti.h</a>>int t_rcvv( int fd, struct t_iovec *iov, unsigned int iovcount, int *flags)</code></pre></blockquote><h4>DESCRIPTION</h4><blockquote><pre><P><table bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Parameters</b><th align=center><b>Before call</b><th align=center><b>After call</b><tr valign=top><td align=left>fd<td align=center>x<td align=center>/<tr valign=top><td align=left>iov<td align=center>x/<tr valign=top><td align=left>iovcount<td align=center>x<td align=center>/<tr valign=top><td align=left>iov[0].iov_base<td align=center>x(/)<td align=center>=(x)<tr valign=top><td align=left>iov[0].iov_len<td align=center>x<td align=center>=<tr valign=top><td align=left> . . . .<tr valign=top><td align=left>iov[iovcount-1].iov_base<td align=center>x(/)<td align=center>=(x)<tr valign=top><td align=left>iov[iovcount-1].iov_len<td align=center>x<td align=center>=</table></pre><p>This function receives either normal or expedited data. Theargument <I>fd</I>identifies the local transport endpoint throughwhich data will arrive, <I>iov</I>points to an array of bufferaddress/buffer size pairs (<I>iov_base</I>, <I>iov_len</I>). The <i>t_rcvv()</i>function receives data into the buffers specified by <I>iov[0].iov_base</I>,<I>iov[1].iov_base</I>,through <I>iov[iovcount-1].iov_base</I>,always filling one buffer before proceding to the next.<p><dl><dt><b>Note:</b><dd>The limit on the total number of bytes availablein all buffers passed (that is, <I>iov(0).iov_len + . . + iov(iovcount-1).iov_len)</I>may be constrained byimplementation limits. If no other constraint applies,it will be limited by [INT_MAX]. In practice, theavailability of memory to an application is likely toimpose a lower limit on the amount of data that can besent or received using scatter/gather functions.</dl><p>The argument iovcount contains the number of buffers which islimited to T_IOV_MAX (an implementation-defined value of at least 16).If the limit is exceeded, the function will fail with[TBADDATA].<p>The argument flags may be set on return from <i>t_rcvv()</i>and specifies optional flags as described below.<p>By default, <i>t_rcvv()</i>operates in synchronous mode and willwait for data to arrive if none is currently available.However, if O_NONBLOCK is set (via <i><a href="t_open.html">t_open()</a></i>or <i><a href="fcntl.html">fcntl()</a></i>),<i>t_rcvv()</i>will execute in asynchronous mode and will fail ifno data is available (see [TNODATA] below).<p>On return from the call, if T_MORE is set in flags, thisindicates that there is more data, and the current transportservice data unit (TSDU) or expedited transport service dataunit (ETSDU) must be received in multiple <i>t_rcvv()</i>or <i><a href="t_rcv.html">t_rcv()</a></i>calls. In the asynchronous mode, or under unusual conditions (for example,the arrival of a signal or T_EXDATA event),the T_MORE flag may be seton return from the <i>t_rcvv()</i>call even when the number ofbytes received is less than the total size of all the receivebuffers. Each <i>t_rcvv()</i>with the T_MORE flag set indicatesthat another <i>t_rcvv()</i>must follow to get more data for thecurrent TSDU. The end of the TSDU is identified by thereturn of a <i>t_rcvv()</i>call with the T_MORE flag not set. Ifthe transport provider does not support the concept of a TSDUas indicated in the <I>info</I>argument on return from <i><a href="t_open.html">t_open()</a></i>or<i><a href="t_getinfo.html">t_getinfo()</a></i>,the T_MORE flag is not meaningful and should beignored. If the amount of buffer space passed in <I>iov</I>is greater than zero on the call to <i>t_rcvv()</i>,then<i>t_rcvv()</i>will return 0 only if the end of a TSDU is being returned to the user.<p>On return, the data is expedited if T_EXPEDITED is set inflags. If T_MORE is also set, it indicates that the number ofexpedited bytes exceeded nbytes, a signal has interrupted the call, or that an entire ETSDU was not available (only for transport protocols that support fragmentation of ETSDUs). Therest of the ETSDU will be returned by subsequent calls to <i>t_rcvv()</i>which will return with T_EXPEDITED set in flags. The end ofthe ETSDU is identified by the return of a <i>t_rcvv()</i>call with T_EXPEDITED set and T_MORE cleared. If the entire ETSDU is notavailable it is possible for normal data fragments to be returned between the initial and final fragments of an ETSDU.<p>If a signal arrives,<i>t_rcvv()</i>returns, giving the user any datacurrently available. If no data is available, <i>t_rcvv()</i>returns -1, sets <I>t_errno</I>to [TSYSERR] and <I>errno</I>to [EINTR]. If somedata is available, <i>t_rcvv()</i>returns the number of bytes received and T_MORE is set in flags.<p>In synchronous mode, the only way for the user to benotified of the arrival of normal or expedited data is toissue this function or check for the T_DATA or T_EXDATAevents using the <i><a href="t_look.html">t_look()</a></i>function. Additionally, theprocess can arrange to be notified via the EM interface.</blockquote><h4>VALID STATES</h4><blockquote>T_DATAXFER, T_OUTREL</blockquote><h4>ERRORS</h4><blockquote>On failure, <I>t_errno</I>is set to one of the following:<dl compact><dt>[TBADDATA]<dd><I>iovcount</I>is greater than T_IOV_MAX.<dt>[TBADF]<dd>The specified file descriptor does not refer to a transport endpoint.<dt>[TLOOK]<dd>An asynchronous event has occurred on thistransport endpoint and requires immediate attention.<dt>[TNODATA]<dd>O_NONBLOCK was set, but no data is currentlyavailable from the transport provider.<dt>[TNOTSUPPORT]<dd>This function is not supported by the underlying transport provider.<dt>[TOUTSTATE]<dd>The communications endpoint referenced by<I>fd</I>is not in one of the states in which a call to this function is valid.<dt>[TPROTO]<dd>This error indicates that a communicationproblem has been detected between XTI andthe transport provider for which there is noother suitable XTI error<I>(t_errno)</I>.<dt>[TSYSERR]<dd>A system error has occurred during execution of this function.</dl></blockquote><h4>RETURN VALUE</h4><blockquote>On successful completion, <i>t_rcvv()</i>returns the number of bytes received. Otherwise, it returns -1 on failure and<I>t_errno</I>is set to indicate the error.</blockquote><h4>SEE ALSO</h4><blockquote><i><a href="fcntl.html">fcntl()</a></i>,<i><a href="t_getinfo.html">t_getinfo()</a></i>,<i><a href="t_look.html">t_look()</a></i>,<i><a href="t_open.html">t_open()</a></i>,<i><a href="t_rcv.html">t_rcv()</a></i>,<i><a href="t_snd.html">t_snd()</a></i>,<i><a href="t_sndv.html">t_sndv()</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -