Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Apropos / Subsearch:
optional field

T_RCV(3N)                                                            T_RCV(3N)

       t_rcv - receive normal or expedited data sent over a connection

       int t_rcv(fd, buf, nbytes, flags)

       int fd;
       char *buf;
       unsigned nbytes;
       int *flags;

       t_rcv()  receives  either  normal or expedited data.  fd identifies the
       local transport endpoint through which data will arrive, buf points  to
       a  receive  buffer where user data will be placed, and nbytes specifies
       the size of the receive buffer.   flags  may  be  set  on  return  from
       t_rcv() and specifies optional flags as described below.

       By default, t_rcv() operates in synchronous mode and will wait for data
       to arrive if none is currently available.  However, if T_NDELAY is  set
       (using  t_open(3N)  or  fcntl()),  t_rcv() will execute in asynchronous
       mode and will fail if no data is available.  See TNODATA below.

       On return from the call, if T_MORE is set in flags this indicates  that
       there  is  more data and the current transport service data unit (TSDU)
       or expedited transport service data unit (ETSDU) must  be  received  in
       multiple  t_rcv()  calls.   Each t_rcv() with the T_MORE flag set indi-
       cates that another t_rcv() must follow immediately to get more data for
       the current TSDU.  The end of the TSDU is identified by the return of a
       t_rcv() call with the T_MORE flag not set.  If the  transport  provider
       does  not  support the concept of a TSDU as indicated in the info argu-
       ment on return from t_open(3N) or t_getinfo(3N), the T_MORE flag is not
       meaningful and should be ignored.

       On return, the data returned is expedited data if T_EXPEDITED is set in
       flags.  If the number  of  bytes  of  expedited  data  exceeds  nbytes,
       t_rcv()  will  set  T_EXPEDITED  and  T_MORE on return from the initial
       call.  Subsequent calls to retrieve the remaining ETSDU will  not  have
       T_EXPEDITED  set  on return.  The end of the ETSDU is identified by the
       return of a t_rcv() call with the T_MORE flag not set.

       If expedited data arrives after part of  a  TSDU  has  been  retrieved,
       receipt  of the remainder of the TSDU will be suspended until the ETSDU
       has been processed.  Only after  the  full  ETSDU  has  been  retrieved
       (T_MORE  not  set)  will  the remainder of the TSDU be available to the

       On success, t_rcv() returns the number of bytes received.  On  failure,
       it returns -1.

       TBADF               The  specified  file descriptor does not refer to a
                           transport endpoint.

       TLOOK               An asynchronous event has occurred on  this  trans-
                           port endpoint and requires immediate attention.

       TNODATA             T_NDELAY  was  set, but no data is currently avail-
                           able from the transport provider.

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

       TSYSERR             The  function  failed due to a system error and set
                           errno to indicate the error.

       t_open(3N), t_snd(3N)

                                21 January 1990                      T_RCV(3N)