/** * Closes this transceiver and disconnects from the remote peer. * Cancels all pending RPCs, sends an IOException to all pending callbacks, * and blocks until the close has completed. */ @Override public void close() { close(true); }
quitOnFailure.set(true); now = System.currentTimeMillis(); transceiver.close(); // Without the patch, this close seems to hang forever
/** * Closes this transceiver and disconnects from the remote peer. * Cancels all pending RPCs, sends an IOException to all pending callbacks, * and blocks until the close has completed. */ @Override public void close() { close(true); }
public static void main(String[] args) throws IOException { if (args.length != 3) { System.out.println("Usage: <to> <from> <body>"); System.exit(1); } logger.info("Starting Server"); // usually this would be another app, but for simplicity startServer(); logger.info("Server started"); NettyTransceiver client = new NettyTransceiver(new InetSocketAddress(65333)); // client code - attach to the server and send a message EmailSender proxy = SpecificRequestor.getClient(EmailSender.class, client); logger.info("Client built, got proxy"); // fill in the Message record and send it EmailMessage message = new EmailMessage(); message.setTo(new Utf8(args[0])); message.setFrom(new Utf8(args[1])); message.setBody(new Utf8(args[2])); logger.info("Calling proxy.send with message: {} ", message.toString()); logger.info("Result: {}", proxy.send(message)); // cleanup client.close(); server.close(); } }
nettyTransceiver.close(); updateExecutor.shutdownNow();