test_class.file: core/src/test/java/dk/alexandra/fresco/framework/network/socket/TestSocketNetwork.java
test_class.identifier: TestSocketNetwork
test_class.superclass: extends AbstractCloseableNetworkTest
test_case.body: @Test
    public void testSenderFailsWhileStopping()
        throws InterruptedException, ExecutionException, IOException {
      final int numParties = 2;
      List<NetworkConfiguration> confs = getNetConfs(numParties);
      ExecutorService es = Executors.newFixedThreadPool(numParties);
      List<Future<NetworkConnector>> fs = new ArrayList<>(numParties);
      try {
        for (int i = 0; i < numParties; i++) {
          final int id = i;
          fs.add(es.submit(() -> new Connector(confs.get(id), DEFAULT_CONNECTION_TIMEOUT)));
        }
        Map<Integer, Socket> socketMap = fs.get(0).get().getSocketMap();
        Sender s = new Sender(socketMap.get(2));
        socketMap.get(2).close();
        s.stop();
      } finally {
        for (Future<NetworkConnector> futureConn : fs) {
          for (Socket s : futureConn.get().getSocketMap().values()) {
            s.close();
          }
        }
        es.shutdownNow();
      }
    }
test_case.class_method_signature: TestSocketNetwork.testSenderFailsWhileStopping()
test_case.full_signature: @Test public void testSenderFailsWhileStopping()
test_case.identifier: testSenderFailsWhileStopping
test_case.invocations: getNetConfs newFixedThreadPool add submit get getSocketMap get get get close get stop values getSocketMap get close shutdownNow
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSenderFailsWhileStopping()
focal_class.declarator: RECEIVE_TIMEOUT = Duration.ofMillis(100)
focal_class.modifier: private static final
focal_class.original_string: private static final Duration RECEIVE_TIMEOUT = Duration.ofMillis(100);
focal_class.type: Duration
focal_class.var_name: RECEIVE_TIMEOUT
focal_class.declarator: logger = LoggerFactory.getLogger(SocketNetwork.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(SocketNetwork.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: selfQueue
focal_class.modifier: private final
focal_class.original_string: private final BlockingQueue<byte[]> selfQueue;
focal_class.type: BlockingQueue<byte[]>
focal_class.var_name: selfQueue
focal_class.declarator: conf
focal_class.modifier: private final
focal_class.original_string: private final NetworkConfiguration conf;
focal_class.type: NetworkConfiguration
focal_class.var_name: conf
focal_class.declarator: alive
focal_class.modifier: private
focal_class.original_string: private boolean alive;
focal_class.type: boolean
focal_class.var_name: alive
focal_class.declarator: sockets
focal_class.modifier: private final
focal_class.original_string: private final Collection<Socket> sockets;
focal_class.type: Collection<Socket>
focal_class.var_name: sockets
focal_class.declarator: senders
focal_class.modifier: private final
focal_class.original_string: private final Map<Integer, Sender> senders;
focal_class.type: Map<Integer, Sender>
focal_class.var_name: senders
focal_class.declarator: receivers
focal_class.modifier: private final
focal_class.original_string: private final Map<Integer, Receiver> receivers;
focal_class.type: Map<Integer, Receiver>
focal_class.var_name: receivers
focal_class.file: core/src/main/java/dk/alexandra/fresco/framework/network/socket/SocketNetwork.java
focal_class.identifier: SocketNetwork
focal_class.interfaces: implements CloseableNetwork
focal_class.class_method_signature: SocketNetwork.SocketNetwork(NetworkConfiguration conf, Map<Integer, Socket> socketMap)
focal_class.full_signature: public  SocketNetwork(NetworkConfiguration conf, Map<Integer, Socket> socketMap)
focal_class.identifier: SocketNetwork
focal_class.modifiers: public
focal_class.parameters: (NetworkConfiguration conf, Map<Integer, Socket> socketMap)
focal_class.signature:  SocketNetwork(NetworkConfiguration conf, Map<Integer, Socket> socketMap)
focal_class.class_method_signature: SocketNetwork.SocketNetwork(NetworkConfiguration conf)
focal_class.full_signature: public  SocketNetwork(NetworkConfiguration conf)
focal_class.identifier: SocketNetwork
focal_class.modifiers: public
focal_class.parameters: (NetworkConfiguration conf)
focal_class.signature:  SocketNetwork(NetworkConfiguration conf)
focal_class.class_method_signature: SocketNetwork.startCommunication(Map<Integer, Socket> sockets)
focal_class.full_signature: private void startCommunication(Map<Integer, Socket> sockets)
focal_class.identifier: startCommunication
focal_class.modifiers: private
focal_class.parameters: (Map<Integer, Socket> sockets)
focal_class.return: void
focal_class.signature: void startCommunication(Map<Integer, Socket> sockets)
focal_class.class_method_signature: SocketNetwork.send(int partyId, byte[] data)
focal_class.full_signature: @Override public void send(int partyId, byte[] data)
focal_class.identifier: send
focal_class.modifiers: @Override public
focal_class.parameters: (int partyId, byte[] data)
focal_class.return: void
focal_class.signature: void send(int partyId, byte[] data)
focal_class.class_method_signature: SocketNetwork.receive(final int partyId)
focal_class.full_signature: @Override public byte[] receive(final int partyId)
focal_class.identifier: receive
focal_class.modifiers: @Override public
focal_class.parameters: (final int partyId)
focal_class.return: byte[]
focal_class.signature: byte[] receive(final int partyId)
focal_class.class_method_signature: SocketNetwork.inRange(final int partyId)
focal_class.full_signature: private void inRange(final int partyId)
focal_class.identifier: inRange
focal_class.modifiers: private
focal_class.parameters: (final int partyId)
focal_class.return: void
focal_class.signature: void inRange(final int partyId)
focal_class.class_method_signature: SocketNetwork.closeCommunication()
focal_class.full_signature: private void closeCommunication()
focal_class.identifier: closeCommunication
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void closeCommunication()
focal_class.class_method_signature: SocketNetwork.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: SocketNetwork.getNoOfParties()
focal_class.full_signature: @Override public int getNoOfParties()
focal_class.identifier: getNoOfParties
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNoOfParties()
focal_method.body: @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());
      }
    }
focal_method.class_method_signature: SocketNetwork.close()
focal_method.full_signature: @Override public void close()
focal_method.identifier: close
focal_method.invocations: noOfParties info getMyId safe closeCommunication info getMyId info getMyId
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void close()