[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Communications, Volume 1


clntudp_create Subroutine

Purpose

Creates a User Datagram Protocol/Internet Protocol (UDP/IP) client transport handle.

Library

C Library (libc.a)

Syntax

#include <rpc/rpc.h>


CLIENT *clntudp_create (addr, prognum, versnum, wait, sockp)
struct sockaddr_in * addr;
u_long prognum, versnum;
struct timeval wait;
int * sockp;

Description

The clntudp_create subroutine creates a Remote Procedure Call (RPC) client transport handle for a remote program. The client uses UDP as the transport to pass messages to the service.

RPC messages transported by UDP/IP can hold up to 8KB of encoded data. Use this subroutine for procedures that take arguments or return results of less than 8KB.

Parameters


addr Points to the Internet address of the remote program. If the port number for this Internet address (addr->sin_port) is 0, then the value of the addr parameter is set to the port that the remote program is listening on. The clntudp_create subroutine consults the remote portmap daemon for this information.
prognum Specifies the program number of the remote program.
versnum Specifies the version number of the remote program.
wait Sets the amount of time that the UDP/IP transport waits to receive a response before the transport sends another remote procedure call or the remote procedure call times out. The total time for the call to time out is set by the clnt_call macro.
sockp Specifies a pointer to a socket. If the value of the sockp parameter is RPC_ANYSOCK, the clntudp_create subroutine opens a new socket and sets the sockp pointer to that new socket.

Return Values

Upon successful completion, this subroutine returns a valid UDP client handle. If unsuccessful, it returns a value of null.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The callrpc subroutine, clnt_pcreateerror subroutine, clnttcp_create subroutine, svcudp_create subroutine.

The portmap daemon.

The clnt_call macro.

List of RPC Programming References.

Remote Procedure Call (RPC) Overview for Programming and Sockets Overview in AIX 5L Version 5.1 Communications Programming Concepts.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]