Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ svctcp_create(3) — CLIX 3.1r7.6.22

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

xdr_int(3)

xdr_bytes(3)

xdr_getpos(3)

xdr_pointer(3)

xdrrec_create(3)

xdr_array(3)

xdr_destroy(3)

xdr_free(3)

xdr_inline(3)

xdrmem_create(3)

xdr_opaque(3)

xdr_union(3)

xdr_vector(3)

xdr_void(3)



  svctcpcreate(3)                    CLIX                    svctcpcreate(3)



  NAME

    svctcp_create, svcfd_create, svcudp_create - Library functions for remote
    procedure calls

  LIBRARY

    Berkeley Software Distribution Library (libbsd.a)

  SYNOPSIS

    SVCXPRT * svctcp_create(
      int sock ,
      uint send_buf_size ,
      uint recv_buf_size );

    void svcfd_create(
      int fd ,
      uint send_buf_size ,
      uint recv_buf_size );

    SVCXPRT * svcudp_create(
      int sock );

  PARAMETERS

    sock            Specifies the socket file descriptor, or RPC_ANYSOCK to
                    request the creation of a socket.

    send_buf_size   Specifies the size of the send buffer; 0 requests that a
                    reasonable default be chosen.

    recv_buf_size   Specifies the size of the receive buffer; 0 requests that
                    a reasonable default be chosen.

    fd              Specifies the file descriptor for a socket that is already
                    open and connected.

  DESCRIPTION

    The svctcp_create(), svcfd_create(), and svcudp_create() functions allow C
    programs to make procedure calls on other machines across the network.
    First, the client calls a procedure to send a data packet to the server.
    Upon receipt of the packet, the server calls a dispatch routine to perform
    the requested service, and then sends back a reply.  Finally, the
    procedure call returns to the client.

    The svctcp_create() function creates a TCP/IP-based RPC service transport,
    to which it returns a pointer.  The transport is associated with the sock
    socket, which may be RPC_ANYSOCK, in which case a new socket is created.
    If the socket is not bound to a local TCP port, then this function binds



  2/94 - Intergraph Corporation                                              1






  svctcpcreate(3)                    CLIX                    svctcpcreate(3)



    it to an arbitrary port.  Upon completion, xprt->xp_sock is the
    transport's socket number, and xprt->xp_port is the transport's port
    number.

    Since TCP-based RPC uses buffered I/O, users may specify the size of
    buffers; values of 0 choose suitable defaults.

    The svcfd_create() function creates a service on top of any open
    descriptor.  Typically, this descriptor is a connected socket for a stream
    protocol such as TCP.  The send_buf_size and recv_buf_size parameters
    indicate sizes for the send and receive buffers.  If they are 0, a
    reasonable default is chosen.

    The svcudp_create() function creates a UDP/IP-based RPC service transport,
    to which it returns a pointer.  The transport is associated with the sock
    socket, which may be RPC_ANYSOCK, in which case a new socket is created.
    If the socket is not bound to a local UDP port, this function binds it to
    an arbitrary port.  Upon completion, xprt->xp_sock is the transport's
    socket number, and xprt->xp_port is the transport's port number.  Since
    UDP-based RPC messages can only hold up to 8 kilobytes of encoded data,
    this transport cannot be used for procedures that take large arguments or
    return huge results.

  RETURN VALUES

    The svctcp_create() and svcudp_create() functions return NULL upon
    failure.  If successful, these functions returns a valid RPC service
    transport handle.

    The svcfd_create() function returns void.

  RELATED INFORMATION

    Functions:  xdr_int(3), xdr_bytes(3), xdr_getpos(3), xdr_pointer(3),
    xdrrec_create(3), xdr_array(3), xdr_destroy(3), xdr_free(3),
    xdr_inline(3), xdrmem_create(3), xdr_opaque(3), xdr_union(3),
    xdr_vector(3), xdr_void(3)

    CLIX Programming Guide















  2                                              Intergraph Corporation - 2/94




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