@Override public void close() { if (closed.compareAndSet(false, true)) { ((NetLightClient) client).close(); loopGroup.shutdownGracefully(); serverSentMessageNotifier.stop(); } }
public boolean connect() { if (closed.get()) { throw new IllegalStateException("Connector closed"); } return client.connect(); }
public MessageFuture send(MessagePromise promise) { if (closed.get()) { throw new IllegalStateException("Connector closed"); } return messageHandler.send(promise); }