/** * Wait until the expected response is received or the timeout has expired. * * @param expectedResponseTypes * list of the expected response message types * @param receiveTimeout * the timeout in milliseconds used to wait for a response from the node. If <code>null</code> the * default timeout is used. * @return the received response * @throws InterruptedException * thrown if wait wait for response is interrupted */ private BidibMessage receive(List<Integer> expectedResponseTypes, Integer receiveTimeout) throws InterruptedException { BidibMessage result = null; LOGGER.info("Receive message, expected responseTypes: {}", expectedResponseTypes); try { result = getMessage(expectedResponseTypes, receiveTimeout); } finally { if (result == null) { // no result was fetched resetNextSendMsgNum(); } } LOGGER.info("Received result: {}", result); return result; }