private MessageFuture send(MessagePromise promise) { Objects.requireNonNull(promise); long id = ID.incrementAndGet(); promise.message().put(MESSAGE_ID, id); messageTracking.put(id, promise); clientHandler.sendMessage(promise); return promise; }
private MessageFuture send(Message message) { Objects.requireNonNull(message); long id = ID.incrementAndGet(); message.put(MESSAGE_ID, id); MessagePromise promise = new DefaultMessagePromise(message, remoteAddress); messageTracking.put(id, promise); clientHandler.sendMessage(promise); return promise; }