t_accept.3xti
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3XTI 代码 · 共 181 行
3XTI
181 行
.\".TH t_accept 3xti.SH Namet_accept \- accept a connect request.SH Syntax.B #include <xti.h>.br.sp 1.sp 1.B int t_accept(\fIfd, resfd, call\fB).br.B int \fIfd\fB;.br.B int \fIresfd\fB;.br.B struct t_\fIcall\fB *\fIcall\fB;.SH Arguments.IP \fIfd\fR 10Identifies the local transport endpoint where the connect indicationarrived..IP \fIresfd\fR 10Specifies the local transport endpoint where the connection is to beestablished..IP \fIcall\fR 10Contains information required by the transport provider to complete theconnection. .IP The \fICall\fR argument points to a \fBt_call\fR structure that contains thefollowing members:.EXstruct netbuf \fIaddr\fP;struct netbuf \fIopt\fP;struct netbuf \fIudata\fP;int \fIsequence\fR;.EE.IP In \fIcall\fR, the members have the following meanings:.RS 10.IP \fIaddr\fP 12Specifies the address of the caller. .IP \fIopt\fP 12Indicates any protocol-specific parameters associated with the connection..IP \fIudata\fP 12Points to any user data to be returned to the caller..IP \fIsequence\fP 12Is the value returned by .PN t_listen()that uniquely associates the response with a previously received connect indication..RE.SH Description.NXR "t_accept system call".NXR "transport user" "accepting connection"A transport user issues this function to accept a connectrequest. A transport user can accept a connection on either the same,or on a different local transport endpoint than the one on which theconnect indication arrived. Before the connection can be accepted onthe same endpoint (\fIresfd==fd\fR), the user must have responded toany previous connect indications received on that transport endpoint bymeans of .PN t_accept() or .PN t_snddis()\fR.\fROtherwise,.PN t_accept()fails and sets \fBt_errno\fR to [TBADF]..PP If a different transport endpoint is specified (\fIresfd!=fd\fR), theendpoint must be bound to a protocol address (if it is the same,\fIqlen\fR must be set to 0) and must be in the T_IDLE state beforethe .PN t_accept() is issued. .PPFor both types of endpoints, .PN t_accept() fails and sets\fBt_errno\fR to [TLOOK] if there are connection indications, (for example,connect or disconnect) waiting to be received on that endpoint..PPThe values of parameters specified by \fIopt\fR and the syntax of thosevalues are protocol-specific. The \fIudata\fR argument enables thecalled transport user to send user data to the caller and the amount ofuser data must not exceed the limits supported by the transport provider asreturned in the \fIconnect\fR field of the \fIinfo\fR argument of.PN t_open() or .PN t_getinfo(). If the \fIlen\fR field of\fIudata\fR is zero, no data is sent to the caller..PPAll the \fImaxlen\fR fields are meaningless..PP.TStab(@);lfHB lfHB lfHBlfR lfR lfR ._.sp 4pParameters@Before Call@After Call.sp 4p_.sp 6pfd@x@/resfd@x@/call->addr.maxlen@/@/call->addr.len@x@/call->addr.buf@?(?)@/call->opt.maxlen@/@/call->opt.len@x@/call->opt.buf@?(?)@/call->udata.maxlen@/@/call->udata.len@x@/call->udata.buf@?(?)@/call->sequence@x@/.sp 6p_.TE.PP.\" For example,.\" .NX R "ftp program" "options".\" places ftp program with options as a subentry in the regular and .\" master index..\" .\".\" .EX means "start example".\" .EE means "end example".\" Check to be sure example is not too wide for the page.SH Return ValuesUpon successful completion, a value of 0 is returned. On failure, avalue of \-1 is returned, and \fBt_errno\fR is set to indicate theerror..SH DiagnosticsOn failure, \fBt_errno\fR is set to one of the following:.TP 20[TBADF]The file descriptor \fIfd\fR or \fIresfd\fR does not refer to atransport endpoint, or the user is illegally accepting a connection onthe same transport endpoint on which the connect indication arrived..TP 20 [TOUTSTATE]The function was issued in the wrong sequence on the transport endpointreferenced by \fIfd\fR, or the transport endpoint referred to by\fIresfd\fR is not in the appropriate state..TP 20[TACCES]The user does not have permission to accept a connection on theresponding transport endpoint or to use the specified options..TP 20[TBADOPT]The specified options were in an incorrect format or containedillegal information..TP 20[TBADDATA]The specific amount of user data was not within the bounds allowed bythe transport provider..TP 20[TBADADDR]The specified protocol address was in an incorrect format or containedillegal information..TP 20[TBADSEQ]The specified sequence number was invalid..TP 20[TLOOK]An asynchronous event has occurred on the transport endpoint referencedby \fIfd\fR and requires immediate attention..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..SH See Alsot_connect(3xti), t_getstate(3xti), t_listen(3xti), t_open(3xti) ,t_optmgmt(3xti),t_rcvconnect(3xti)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?