int mb_send( int socket, char *app_name, int msg_type, int msg_id, int msg_len, u_char *msg )
mb_send sends msg_len bytes of msg to another process registered as app_name.
socket is a connector returned by a previous call to
msg_id is a request number which can be used to uniquely identify the reply.
msg_type can be MB_ONEWAY, MB_TWOWAY or MB_MULTIWAY. Include mb.h to define these constants.
|MB_ONEWAY||'1'||Sends msg to a process registered as app_name. Asks for no reply.|
|MB_TWOWAY||'2'||Sends msg to a process registered as app_name. Asks for a reply.|
|MB_MULTIWAY||'M'||Broadcasts msg to all processes registered as app_name. Asks for no reply.|
mb_send returns 0 if msg could be written to socket or -1 if an error occurred.
If msg_type is MB_ONEWAY or MB_MULTIWAY, no reply is expected from the process or the processes registered as app_name. If msg_type is MB_TWOWAY, the process registered as app_name is expected to return a reply message.
If no process is registered in the domain app_name, the bus sends a MB_NOBODY message to the sender. If a reply is expected and the receiver doesn't reply after a certain delay, 60 seconds in the standard configuration, the bus sends a MB_TIMEOUT to the sender.