universal.communication
Class Sender

java.lang.Object
  |
  +--universal.communication.Sender

public class Sender
extends java.lang.Object

To send messages via the TCP socket (in order to simulate a reliable channel). The messages send via the socket are those for the consensus and the leader election.


Field Summary
 int pid
          The pid of the process that is going to send messages
 java.util.Vector processes
          List of the replicated server plus the client .
 java.util.Vector processesReplicas
          List of the replicated servers that messages for the consensus should be send
 universal.Universal uni
          The Universal Object that this sender is linked to.
 
Constructor Summary
Sender(universal.Universal uni)
           
 
Method Summary
 void s_send(universal.Message m, java.net.InetAddress address, int port)
          Send message through Universal's socket to the specified address and port
 void s_send(universal.Message m, java.util.Vector processesSend)
          Sends the message m through Universal's socket to the proccesses specified in the list processesSend.
 void send(universal.Message m, java.net.InetAddress address, int port)
          Send message through Universal's socket to the specified address and port
 void send(universal.Message m, java.util.Vector processesSend)
          Sends the message m through Universal's socket to the proccesses specified in the list processesSend.
 int totalno()
          Returns the number of replicated server in the list processesReplicas.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

processesReplicas

public java.util.Vector processesReplicas
List of the replicated servers that messages for the consensus should be send


processes

public java.util.Vector processes
List of the replicated server plus the client . The AmAlive messages should be send to all of them.


pid

public int pid
The pid of the process that is going to send messages


uni

public universal.Universal uni
The Universal Object that this sender is linked to.

Constructor Detail

Sender

public Sender(universal.Universal uni)
Method Detail

s_send

public void s_send(universal.Message m,
                   java.util.Vector processesSend)
Sends the message m through Universal's socket to the proccesses specified in the list processesSend.

Parameters:
m - The message that we want to send.
processesSend - The list of processes this message should be send

s_send

public void s_send(universal.Message m,
                   java.net.InetAddress address,
                   int port)
Send message through Universal's socket to the specified address and port


send

public void send(universal.Message m,
                 java.util.Vector processesSend)
Sends the message m through Universal's socket to the proccesses specified in the list processesSend.

Parameters:
m - The message that we want to send.
processesSend - The list of processes this message should be send

send

public void send(universal.Message m,
                 java.net.InetAddress address,
                 int port)
Send message through Universal's socket to the specified address and port


totalno

public int totalno()
Returns the number of replicated server in the list processesReplicas.