Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ listen(2) — HP-UX 5.50

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

accept(2)

connect(2)

socket(2)

inet(4F)

     LISTEN(2)                Series 300 Only                LISTEN(2)

     NAME
          listen - listen for connections on a socket

     SYNOPSIS
          listen(s, backlog)
          int s, backlog;

     HP-UX COMPATIBILITY
          Level:    HP-UX/NON-STANDARD

          Origin:   UCB

          Remarks:  Implemented on the Series 300 only.

     DESCRIPTION
          To accept  connections,  a  socket  is  first  created  with
          socket(2),  a  queue  for  incoming connections is specified
          with listen(2) and then the connections  are  accepted  with
          accept(2).   The  listen  call  applies  only to unconnected
          sockets of type SOCK_STREAM.  If the  socket  has  not  been
          bound to a local port before the listen is invoked, then the
          system will automatically bind a local port for  the  socket
          to listen on (see inet(4F)).

          The s parameter is a socket descriptor  of  the  socket  for
          which the listen queue will be established.

          The backlog parameter defines the maximum  length  to  which
          the  queue of pending connections may grow.  If a connection
          request arrives with the queue full, the client will receive
          an error with an indication of ETIMEDOUT.

          The call to listen fails if:

          [EBADF]             The  argument   s   is   not   a   valid
                              descriptor.

          [ENOTSOCK]          The argument s is not a socket.

          [EOPNOTSUPP]        The  socket  is  not  of  a  type   that
                              supports the operation listen.

          [ENOBUFS]           No  buffer  space  is  available.    The
                              listen can not be started at this time.

          [EINVAL]            Socket has been shut down or is  already
                              connected.

          [ENET]              A hardware  error  is  detected  on  the
                              interface card.

     RETURN VALUE

     Hewlett-Packard               - 1 -             (printed 7/16/86)

     LISTEN(2)                Series 300 Only                LISTEN(2)

          A 0 return value indicates success; -1 indicates an error.

     SEE ALSO
          accept(2), connect(2), socket(2), inet(4F).

     HARDWARE DEPENDENCIES
          Series 300:
               The backlog is currently limited (silently)  to  be  in
               the  range  of 1 to 5.  If you specify any other value,
               the system  automatically  assigns  the  closest  value
               within range.

     Hewlett-Packard               - 2 -             (printed 7/16/86)

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