clnt_broadcast Subroutine

Purpose

Broadcasts a remote procedure call to all locally connected networks.

Library

C Library (libc.a)

Syntax

#include <rpc/rpc.h>

enum clnt_stat clnt_broadcast (prognumversnumprocnum, inproc)
enum clnt_stat clnt_broadcast (inoutprocouteachresult)
u_long  prognum versnum procnum;
xdrproc_t  inproc;
char * in;
xdrproc_t  outproc;
char * out;
resultproc_t  eachresult;

Description

The clnt_broadcast subroutine broadcasts a remote procedure call to all locally connected networks. The remote procedure is identified by the prognum, versnum, and procnum parameters on the workstation identified by the host parameter.

Broadcast sockets are limited in size to the maximum transfer unit of the data link. For Ethernet, this value is 1500 bytes.

When a client broadcasts a remote procedure call over the network, a number of server processes respond. Each time the client receives a response, the clnt_broadcast subroutine calls the eachresult routine. The eachresult routine takes the following form:

eachresult (out, *addr)
char *out;
struct sockaddr_in *addr;

Parameters

Item Description
prognum Specifies the number of the remote program.
versnum Specifies the version number of the remote program.
procnum Identifies the procedure to be called.
inproc Specifies the procedure that encodes the procedure's parameters.
in Specifies the address of the procedure's arguments.
outproc Specifies the procedure that decodes the procedure results.
out Specifies the address where results are placed.
eachresult Specifies the procedure to call when clients respond.
addr Specifies the address of the workstation that sent the results.

Return Values

If the eachresult subroutine returns a value of 0, the clnt_broadcast subroutine waits for more replies. Otherwise, the clnt_broadcast subroutine returns with the appropriate results.