private <T extends Serializable> void sendObject(CommunicationPatternAgent agent,
      Connection connection,
      String logMessageName, T obj) throws FatalErrorHalt, AbortRound {
    byte[] data = null;
    data = agent.serialize(obj);
    logJson(LogFlag.serialization, "mica-serialize-bytes-" + logMessageName, data.length);
    byte[] lengthBytes = serializeInteger(data.length);
    try {
      connection.getOutputStream().write(lengthBytes);
      connection.getOutputStream().write(data);
    } catch (SocketException se) {
      // FIXME: check that handleError is aborting on GOSSIP_IO_ERROR
      // handleError(GOSSIP_IO_ERROR, se);
      handleError(GOSSIP_IO_ERROR, new AbortRound());
    } catch (IOException e) {
      // FIXME: check that handleError is aborting on GOSSIP_IO_ERROR
      // handleError(GOSSIP_IO_ERROR, e);
      handleError(GOSSIP_IO_ERROR, new AbortRound());
    }
  }
private <T extends Serializable> void sendObject(CommunicationPatternAgent agent,
      Connection connection,
      String logMessageName, T obj) throws FatalErrorHalt, AbortRound {
    byte[] data = null;
    data = agent.serialize(obj);
    logJson(LogFlag.serialization, "mica-serialize-bytes-" + logMessageName, data.length);
    byte[] lengthBytes = serializeInteger(data.length);
    try {
      connection.getOutputStream().write(lengthBytes);
      connection.getOutputStream().write(data);
    } catch (SocketException se) {
     
     
      handleError(GOSSIP_IO_ERROR, new AbortRound());
    } catch (IOException e) {
     
     
      handleError(GOSSIP_IO_ERROR, new AbortRound());
    }
  }
private <t extends serializable> void sendobject(communicationpatternagent agent, connection connection, string logmessagename, t obj) throws fatalerrorhalt, abortround { byte[] data = null; data = agent.serialize(obj); logjson(logflag.serialization, "mica-serialize-bytes-" + logmessagename, data.length); byte[] lengthbytes = serializeinteger(data.length); try { connection.getoutputstream().write(lengthbytes); connection.getoutputstream().write(data); } catch (socketexception se) { handleerror(gossip_io_error, new abortround()); } catch (ioexception e) { handleerror(gossip_io_error, new abortround()); } }