Next: Message and queue manipulation
Up: Available routines in the
Previous: Available routines in the
  Contents
- NAME
- : send_to, pass_message, send_both, port_send - Send messages from one node to another.
- SYNTAX
- :
send_to( MESSAGE *m, int p )
pass_message( int n )
send_both( MESSAGE *m )
int port_send( int n )
- DESCRIPTION
- :
- send_to sends message m on the port p. Additionally, it computes the delay of the tramsmittion and puts at the field m->port the port of the receiving node n from which this message will be received, increases by one the field m->hops and inserts message m in the receiving node's message queue PCB[n].mes_buf.
send_to also schedules the corresponding event ( RECMES) for the recepient node. If the link relevant to port p is about to fail when message m is sent, then send_to doesn't insert the message in the receiving node's message queue nor does it schedule the corresponding event ( RECMES) for the receiving node.
In case of the use of a synchronizer, send_to does not schedule the RECMES event. This event will be scheduled by the receiving node. For ring topology algorithms, port p can have the predefined values LEFTPORT, RIGHTPORT, which make send_to send the message to the left or right neighbour, respectively.
- pass_message does the same things as send_to does, by sending the currently received message CURMESS on port p.
- send_both can be used only in ring topology protocols; it sends message m to both neighbours of current node me. It has the same effects as send_to.
- port_send is an auxilliary function that returns the number port of current node me on which messages are sent to node n.
- DIAGNOSTICS
- The message sending routines produce error messages and cause the simulator to stop execution when an invalid node or invalid port number is given or a null message is tried to be sent.
SEE ALSO: System structure (Section 5.2), Simulator model (Section 4.1).
Next: Message and queue manipulation
Up: Available routines in the
Previous: Available routines in the
  Contents
Ha Hoai Phuong
2002-11-11