Midas RPC Functions (rpc_xxx)
[The midas.h & midas.c]


Functions

INT rpc_register_client (char *name, RPC_LIST *list)
INT rpc_register_functions (RPC_LIST *new_list, INT(*func)(INT, void **))
INT rpc_set_option (HNDLE hConn, INT item, INT value)
INT rpc_send_event (INT buffer_handle, void *source, INT buf_size, INT async_flag, INT mode)
INT rpc_flush_event ()


Function Documentation

INT rpc_flush_event  ) 
 

Send event residing in the TCP cache buffer filled by rpc_send_event. This routine should be called when a run is stopped.

Returns:
RPC_SUCCESS, RPC_NET_ERROR

Definition at line 9665 of file midas.c.

Referenced by scan_fragment(), scheduler(), send_event(), and tr_stop().

INT rpc_register_client char *  name,
RPC_LIST *  list
 

Register RPC client for standalone mode (without standard midas server)

Parameters:
list Array of RPC_LIST structures containing function IDs and parameter definitions. The end of the list must be indicated by a function ID of zero.
name Name of this client
Returns:
RPC_SUCCESS

Definition at line 7535 of file midas.c.

INT rpc_register_functions RPC_LIST *  new_list,
INT(*)(INT, void **)  func
 

Register a set of RPC functions (both as clients or servers)

Parameters:
new_list Array of RPC_LIST structures containing function IDs and parameter definitions. The end of the list must be indicated by a function ID of zero.
func Default dispatch function
Returns:
RPC_SUCCESS, RPC_NO_MEMORY, RPC_DOUBLE_DEFINED

Definition at line 7555 of file midas.c.

Referenced by cm_connect_experiment1(), and rpc_register_client().

INT rpc_send_event INT  buffer_handle,
void *  source,
INT  buf_size,
INT  async_flag,
INT  mode
 

Fast send_event routine which bypasses the RPC layer and sends the event directly at the TCP level.

Parameters:
buffer_handle Handle of the buffer to send the event to. Must be obtained via bm_open_buffer.
source Address of the event to send. It must have a proper event header.
buf_size Size of event in bytes with header.
async_flag SYNC / ASYNC flag. In ASYNC mode, the function returns immediately if it cannot send the event over the network. In SYNC mode, it waits until the packet is sent (blocking).
mode Determines in which mode the event is sent. If zero, use RPC socket, if one, use special event socket to bypass RPC layer on the server side.
Returns:
BM_INVALID_PARAM, BM_ASYNC_RETURN, RPC_SUCCESS, RPC_NET_ERROR, RPC_NO_CONNECTION, RPC_EXCEED_BUFFER

Definition at line 9465 of file midas.c.

Referenced by receive_trigger_event(), scheduler(), send_event(), and source_scan().

INT rpc_set_option HNDLE  hConn,
INT  item,
INT  value
 

Set RPC option

Parameters:
hConn RPC connection handle
item One of RPC_Oxxx
value Value to set
Returns:
RPC_SUCCESS

Definition at line 8554 of file midas.c.

Referenced by bm_receive_event(), cm_transition(), db_send_changed_records(), main(), scheduler(), and update_odb().


Midas DOC Version 2.0.1 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Exaos Lee - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk