Package communication

Examples of communication.TextMessage


  @Override
  public void insert(int pos, char c) {
    System.out.println("I am going to send an insertion " + c + " at " + pos);

    /* Create the message and send it */
    TextMessage tm = new TextMessage(pos, c, TextMessage.INSERT, peerIndex, null);
    if (peerIndex != Main.rootPeer) {
      peerSender.send(tm);
      return;
    }
   
View Full Code Here


  @Override
  public void delete(int pos) {
    System.out.println("I am going to send a deletion at " + pos);

    TextMessage tm = new TextMessage(pos, 'q', TextMessage.DELETE, peerIndex, null);
    if (peerIndex != Main.rootPeer) {
      peerSender.send(tm);
      return;
    }
   
View Full Code Here

    logLock.lock();

    Iterator<DOPTTextMessage> it = log.descendingIterator();
    while (it.hasNext()) {
      System.out.println("Intru in bucla");
      TextMessage tm = it.next();
      DOPTTextMessage current = (DOPTTextMessage)tm;

      if (consider) {
        int comp = compareStateVectors(current.stateVector, stateVector);
        System.out.println("Comp dintr " + current + " si al meu e " + comp);
View Full Code Here

    /* Update the time vector */
    timeVector.VT.set(peerIndex, timeVector.VT.get(peerIndex) + 1);

    /* Create the message and send it */
    TextMessage tm = new TextMessage(pos, c, TextMessage.INSERT, peerIndex, timeVector);
    for (int i = 0; i < Main.peerCount - 1; i++)
      senders.get(i).send(tm);
  }
View Full Code Here

    System.out.println("I am going to broadcast a deletion at " + pos);
   
    /* Update the time vector */
    timeVector.VT.set(peerIndex, timeVector.VT.get(peerIndex) + 1);

    TextMessage tm = new TextMessage(pos, 'q', TextMessage.DELETE, peerIndex, timeVector);
    for (int i = 0; i < Main.peerCount - 1; i++)
      senders.get(i).send(tm);
  }
View Full Code Here

TOP

Related Classes of communication.TextMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.