Main Page | Modules | Data Structures | File List | Globals | Examples

Client-side functions


Typedefs

typedef _CMrpc_ticket_struct * CMrpc_ticket

Functions

CMrpc_ticket CMrpc_call_rpc (CManager cm, const char *rpc_name, attr_list contact_info, void *in_data, void *out_data, unsigned long flags)
void CMrpc_call_rpc_oneway (CManager cm, const char *rpc_name, attr_list contact_info, void *in_data, unsigned long flags)
int CMrpc_register_rpc_contact_info (CManager cm, const char *rpc_name, attr_list contact_info)
CMrpc_ticket CMrpc_call_anon_rpc (CManager cm, const char *rpc_name, attr_list target_spec, IOContext anon_in_context, void *in_data, IOContext anon_out_context, void *out_data, unsigned long flags)
int CMrpc_redeem_ticket (CManager cm, CMrpc_ticket ticket, void *out_data, int wait)

Typedef Documentation

typedef struct _CMrpc_ticket_struct* CMrpc_ticket
 

An asynchronous RPC ticket that can be later "redeemed" to retrieve the results of the RPC.


Function Documentation

CMrpc_ticket CMrpc_call_anon_rpc CManager  cm,
const char *  rpc_name,
attr_list  target_spec,
IOContext  anon_in_context,
void *  in_data,
IOContext  anon_out_context,
void *  out_data,
unsigned long  flags
 

Client-side "anonymous" RPC call. An anonymous call is a call to an RPC that is not registered; applications that will only make a single call to RPCs or call them only in rare cases may choose to use this interface. Note that callers must obtain their own IOContext and IOFormat values from either the CM or PBIO format registration interfaces. Operates in the same manner as CMrpc_call_rpc.

Parameters:
cm The CManager in use.
rpc_name The RPC for which this format is to be registered.
target_spec An attr_list containing CM contact information for the server to be contacted.
anon_in_context An IOContext containing all of the format information necessary to encode the parameters to the RPC.
in_data The input data for the RPC.
anon_out_context An IOContext containing all of the format information necessary to encode the parameters to the RPC.
out_data The result data from the RPC.
flags Flags field for the RPC. If CMrpc_async_call is set, the call is made asynchronously; otherwise, the call blocks until the results arrive.
Returns:
If CMrpc_async_call is set, the return value is a CMrpc_ticket that can be used to retrieve the results of the operation; otherwise, the return value is NULL.
See also:
CM (CMFormatList), PBIO (IOFieldList) documentation.
Examples:
ts.c.

CMrpc_ticket CMrpc_call_rpc CManager  cm,
const char *  rpc_name,
attr_list  contact_info,
void *  in_data,
void *  out_data,
unsigned long  flags
 

Client-side RPC call. Message formats and contact information for the RPC must be properly registered before calling this function. in_data and out_data must point to valid buffers corresponding to the registered message formats. If async is 1, the call is made asynchronously and the return value is a CMrpc_ticket that can be used to retrieve the results of the operation; otherwise, the call blocks until the results arrive and the return value is NULL. If async is 1 and the return value is NULL, an error occurred; check CMrpc_errno for an indication of the error.

Parameters:
cm The CManager in use.
rpc_name The RPC being called.
contact_info An attr_list containing CM-style contact information for the RPC server being called.
in_data The input data for the RPC.
out_data The output data for the RPC.
flags Flags field for the RPC. If CMrpc_async_call is set, the call is made asynchronously; otherwise, the call blocks until the results arrive.
Returns:
If CMrpc_async_call is set, the return value is a CMrpc_ticket that can be used to retrieve the results of the operation; otherwise, the return value is NULL.
Examples:
ts.c.

void CMrpc_call_rpc_oneway CManager  cm,
const char *  rpc_name,
attr_list  contact_info,
void *  in_data,
unsigned long  flags
 

Client-side RPC where no reply is expected. Otherwise functions similarly to CMrpc_call_rpc().

Parameters:
cm The CManager in use.
rpc_name The RPC being called.
contact_info An attr_list containing CM-style contact information for the RPC server being called.
in_data The input data for the RPC.
flags Flags field for the RPC. If CMrpc_async_call is set, the call is made asynchronously; otherwise, the call blocks until the results arrive.
Examples:
ts.c.

int CMrpc_redeem_ticket CManager  cm,
CMrpc_ticket  ticket,
void *  out_data,
int  wait
 

Asynchronous RPC ticket redemption. A valid CMrpc_ticket can be exchanged for operation results using this function. wait specifies whether the caller wishes to block until results are available or return immediately whether they are available or not. A NULL result indicates that the result was available and has been placed in out_data; otherwise, ticket is returned.

Parameters:
cm The CManager in use.
ticket The CMrpc_ticket to be redeemed.
out_data Output data for the ticket.
wait If wait == 1, and the results of the RPC are not yet available, this call blocks until the results arrive. If wait == 0 and the results are not yet available, this call does not block and sets CMrpc_errno to EAGAIN. If the results are available, they are decoded and placed into out_data.
Returns:
Returns NULL if the requested results were placed into out_data, the provided ticket if not.
Examples:
ts.c.

int CMrpc_register_rpc_contact_info CManager  cm,
const char *  rpc_name,
attr_list  contact_info
 

Used from client-side. Registers the given contact information for the specified rpc name. CM-RPC will use this contact information to establish a transport connection in CM.

Parameters:
cm The CManager in use.
rpc_name The RPC for which to register the contact info.
contact_info An attr_list containing the correct contact information for the CM transport in use.
Returns:
Returns 1 if registration is successful, -1 otherwise (and sets CMrpc_errno).
Examples:
ts.c.


Generated on Thu Oct 14 18:34:49 2004 for CMrpc by  doxygen 1.3.9.1