Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ t_accept(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

netbuf(FP)


 t_accept(S)               (TLI/XTI) 6 January 1993               t_accept(S)


 Name

    t_accept - accept a connect request

 Syntax


    TLI syntax


    cc  . . .  -lnsls


    #include <sys/tiuser.h>

    int t_accept (fd, resfd, call)
    int fd, resfd;
    struct t_call *call;


    XTI syntax


    cc  . . .  -lxti


    #include <xti.h>

    int t_accept (fd, resfd, call)
    int fd, resfd;
    struct t_call *call;


 Description

    This function is issued by a transport user to accept a connect request.
    fd identifies the local transport endpoint where the connect indication
    arrived, resfd specifies the local transport endpoint where the connec-
    tion is to be established, and call contains information required by the
    transport provider to complete the connection.  call points to a tcall
    structure containing the following members:

           struct netbuf addr;   /* caller's address             */
           struct netbuf opt;    /* options                      */
           struct netbuf udata;  /* user data returned by caller */
           int sequence;         /* value returned by t_listen   */

    Refer to netbuf(FP) for information about the netbuf structure.  In call,
    addr is the address of the caller, opt indicates any protocol-specific
    parameters associated with the connection, udata points to any user data
    to be returned to the caller, and sequence is the value returned by
    tlisten that uniquely associates the response with a previously received
    connect indication.

    A transport user may accept a connection on either the same, or on a dif-
    ferent, local transport endpoint than the one on which the connect indi-
    cation arrived.  If the same endpoint is specified (that is, resfd=fd),
    the connection can be accepted unless the following condition is true:
    the user has received other indications on that endpoint but has not
    responded to them (with taccept or tsnddis).  For this condition,
    taccept fails and sets terrno to TBADF.

    If a different transport endpoint is specified (resfd!=fd), the endpoint
    must be bound to a protocol address and must be in the TIDLE state (see
    tgetstate(S)) before the taccept is issued.

    For both types of endpoints, taccept fails and set terrno to TLOOK if
    there are indications (for example, a connect or disconnect) waiting to
    be received on that endpoint.

    The values of parameters specified by opt and the syntax of those values
    are protocol specific.  The udata argument enables the called transport
    user to send user data to the caller and the amount of user data must not
    exceed the limits supported by the transport provider as returned by
    topen or tgetinfo.  If the len field of udata is zero, no data is sent
    to the caller.

    On failure, terrno may be set to one of the following:

    [TACCES]           The user does not have permission to accept a connec-
                       tion on the responding transport endpoint or use the
                       specified options.

    [TBADDATA]         The amount of user data specified was not within the
                       bounds allowed by the transport provider.

    [TBADF]            The specified file descriptor does not refer to a
                       transport endpoint, or the user is illegally accepting
                       a connection on the same transport endpoint on which
                       the connect indication arrived.

    [TBADOPT]          The specified options were in an incorrect format or
                       contained illegal information.

    [TBADSEQ]          An invalid sequence number was specified.

    [TFLOW]            A system error occurred while sending the connect
                       request.

    [TLOOK]            An asynchronous event has occurred on the transport
                       endpoint referenced by fd and requires immediate
                       attention.

    [TNOTSUPPORT]      This function is not supported by the underlying
                       transport provider.

    [TOUTSTATE]        The function was issued in the wrong sequence on the
                       transport endpoint referenced by fd, or the transport
                       endpoint referred to by resfd is not in the TIDLE
                       state.

    [TSYSERR]          A system error occurred during execution of this func-
                       tion.

 See also

    netbuf(FP),

    tconnect(S), tgetstate(S), tlisten(S), topen(S), trcvconnect(S)

 Diagnostics

    Upon successful completion, a value of 0 is returned.  Otherwise, a value
    of -1 is returned and terrno is set to indicate the error.

 Standards conformance

    taccept is conformant with:
    AT&T SVID Issue 2;
    X/Open Portability Guide, Issue 3, 1989;
    and Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2).


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026