Exemplo n.º 1
0
  // ARRG gossip send and handled in ARRG class
  private void handleArrgGossip(Connection connection) throws IOException {
    String poolName = connection.in().readUTF();

    if (!poolName.equals(registry.getPoolName())) {
      connection.closeWithError("wrong pool name");
      return;
    }

    arrg.handleGossip(connection);
  }
Exemplo n.º 2
0
  private void handleGossip(Connection connection) throws IOException {
    IbisIdentifier peer = new IbisIdentifier(connection.in());

    if (peer.equals(registry.getIbisIdentifier())) {
      logger.error("eep! talking to ourselves");
      connection.closeWithError("talking to self");
    }

    if (!peer.poolName().equals(registry.getIbisIdentifier().poolName())) {
      connection.closeWithError("wrong pool");
    }

    pool.readGossipData(connection.in());
    elections.readGossipData(connection.in());

    connection.sendOKReply();

    pool.writeGossipData(connection.out(), gossipSize);
    elections.writeGossipData(connection.out());

    connection.close();
  }