System.out.println("Press any key to send enquireLink #1");
System.in.read();
// demo of a "synchronous" enquireLink call - send it and wait for a response
EnquireLinkResp enquireLinkResp1 = session0.enquireLink(new EnquireLink(), 10000);
logger.info("enquire_link_resp #1: commandStatus [" + enquireLinkResp1.getCommandStatus() + "=" + enquireLinkResp1.getResultMessage() + "]");
System.out.println("Press any key to send enquireLink #2");
System.in.read();
// demo of an "asynchronous" enquireLink call - send it, get a future,
// and then optionally choose to pick when we wait for it
WindowFuture<Integer,PduRequest,PduResponse> future0 = session0.sendRequestPdu(new EnquireLink(), 10000, true);
if (!future0.await()) {
logger.error("Failed to receive enquire_link_resp within specified time");
} else if (future0.isSuccess()) {
EnquireLinkResp enquireLinkResp2 = (EnquireLinkResp)future0.getResponse();
logger.info("enquire_link_resp #2: commandStatus [" + enquireLinkResp2.getCommandStatus() + "=" + enquireLinkResp2.getResultMessage() + "]");