t_snd.3xti

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3XTI 代码 · 共 169 行

3XTI
169
字号
.TH t_snd 3xti.SH Namet_snd \- send data or expedited data over a connection.SH Syntax.B #include <xti.h>.br.sp 1.B int t_snd(\fIfd, buf, nbytes, flags\fB).br.B int \fIfd\fB;.br.B char \fI*buf\fB;.br.B unsigned \fInbytes\fB;.br.B int \fIflags\fR;.SH Arguments.IP \fIfd\fR 10Identifies the local transport endpoint over which data should be sent..IP \fIbuf\fR 10Points to the user data..IP \fInbytes\fR 10Specifies the number of bytes of user data to be sent..IP \fIflags\fR 10Specifies any optional flags described below:.RS 10.IP T_EXPEDITED 14If set in \fIflags\fP, the data is sent as expedited data and is subject to the interpretations of the transport provider..IP T_MORE 14If set in \fIflags\fP, this indicates to the transport provider that the transport service data unit (TSDU) or expedited transport service data unit (ETSDU) is being sent through multiple .PN t_snd()calls. Each .PN t_snd() with the T_MORE flag set indicates that another .PN t_snd()follows with more data for the current TSDU. The end of TSDU or ETSDU is identified by a .PN t_snd()call with the T_MORE flag not set. Use of T_MORE enables a user to break up large logical data units without losing boundariesof those units at the other end of the connection. The flag implies nothing about how the data is packaged for transfer below the transport interface.  If the transport provider does not support the concept of a TSDU as indicated in the \fIinfo\fP argument on return from .PN t_open()or .PN t_getinfo()\fR,\fRthe T_MORE flag is not meaningful and should be ignored..RE.sp 3.SH DescriptionThis function is used to send either normal or expedited data..NXR "t_snd system call".NXR "sendind data" "normal".NXR "sending data" "expedited".PPBy default, .PN t_snd()operates in synchronous mode and may wait if flowcontrol restrictions prevent the data from being accepted by the localtransport provider at the time the call is made. However, ifO_NONBLOCK is set by means of .PN t_open() or .PN fcntl()\fR,\fR.PN t_snd()executes in asynchronous mode, and fails immediately,if there are flow control restrictions. The process can arrange to be informed whenthe flow control restrictions are cleared by means of .PN t_look()\fR.\fR.PPOn successful completion, .PN t_snd() returns the number of bytes accepted by the transport provider. Normally, this equals the numberof bytes specified in \fInbytes\fR. However, if O_NONBLOCK is set,it is possible that only part of the data is accepted by thetransport provider. In this case, .PN t_snd() returns a value that is less than the value of \fInbytes\fR. If \fInbytes\fR is zero andsending of zero octets is not supported by the underlying transportservice, the .PN t_snd() returns \-1 with \fBt_errno\fR set to [TBADDATA]..PPThe size of each TSDU or ETSDU must not exceed the limits of thetransport provider as returned in the TSDU or ETSDU fields of the\fIinfo\fR argument of .PN t_open() or .PN t_getinfo()\fR.\fRFailure to comply results in protocol error (see [TSYSERR]under the DIAGNOSTICS section)..PP The error [TLOOK] may be returned to inform the process thatan event, such as a \fBdisconnect\fR, has occurred..PPIt is important to remember that the transport provider treats all usersof a transport endpoint as a single user. Therefore if several processesissue concurrent .PN t_snd()calls, then the different data may beintermixed..PP.TStab(@);lfHB lfHB lfHBlfR  lfR  lfR ._.sp 6pParameters@Before Call@After Call.sp 6p_.sp 6pfd@x@/buf@x(x)@/nbytes@x@/flags@x@/.sp 6p_.TE.PP.sp 12p.SH Return ValuesUpon successful completion, \fBt_errno\fR returns the number of bytesaccepted by the transport provider. On failure, a value of \-1 is returned, and \fBt_errno\fR is set to indicate the error..PPIn asynchronous mode, if the number of bytes accepted by the transportprovider is less than the number of bytes requested, this may indicatethat the transport provider is blocked due to flow control..SH DiagnosticsOn failure, \fBt_errno\fR is set to one of the following:.TP 20[TBADF]The specified file descriptor does not refer to a transport endpoint..TP 20 [TOUTSTATE]The function was issued in the wrong sequence on the transport endpointreferenced by \fIfd\fR..TP 20[TBADFLAG]An invalid flag was specified..TP 20[TFLOW]O_NONBLOCK was set, but the flow control mechanism prevented thetransport provider from accepting any data at this time..TP[TBADDATA]Illegal amount of data: zero octets is not supported..TP 20[TLOOK]An asynchronous event has occurred on the transport endpoint..TP 20[TNOTSUPPORT]This function is not supported by the underlying transport provider. .TP 20[TSYSERR]A system error has occurred during execution of this function. A protocol error maynot cause \fBt_errno\fR to fail until a subsequent access of the transport endpoint..SH See Also.MS t_getinfo 3xti , .MS t_open 3xti ,.MS t_rcv 3xti 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?