class SocketNetwork implements CloseableNetwork {

  @Override
  public void close() {
    if (alive) {
      alive = false;
      if (conf.noOfParties() < 2) {
        logger.info("P{}: Network closed", conf.getMyId());
        return;
      }
      ExceptionConverter.safe(() -> {
        closeCommunication();
        logger.info("P{}: Network closed", conf.getMyId());
        return null;
      }, "Unable to properly close the network.");
    } else {
      logger.info("P{}: Network already closed", conf.getMyId());
    }
  }

  public  SocketNetwork(NetworkConfiguration conf, Map<Integer, Socket> socketMap);
  public  SocketNetwork(NetworkConfiguration conf);

}