/** * Release or close the underlying {@link Channel} */ @Override default void dispose() { channel().close(); }
/** * Release or close the underlying {@link Channel} */ @Override default void dispose() { channel().close(); }
@Override default boolean isDisposed() { return !channel().isActive(); }
@Override default boolean isDisposed() { return !channel().isActive(); }
/** * Return an observing {@link Mono} terminating with success when shutdown * successfully or error. * * @return a {@link Mono} terminating with success if shutdown successfully or error */ default Mono<Void> onDispose() { return FutureMono.from(channel().closeFuture()); }
/** * Return an observing {@link Mono} terminating with success when shutdown * successfully or error. * * @return a {@link Mono} terminating with success if shutdown successfully or error */ default Mono<Void> onDispose() { return FutureMono.from(channel().closeFuture()); }
/** * Return local server selector channel address. * * @return local {@link InetSocketAddress} */ default InetSocketAddress address(){ Channel c = channel(); if (c instanceof SocketChannel) { return ((SocketChannel) c).remoteAddress(); } if (c instanceof ServerSocketChannel) { return ((ServerSocketChannel) c).localAddress(); } if (c instanceof DatagramChannel) { InetSocketAddress a = ((DatagramChannel) c).remoteAddress(); return a != null ? a : ((DatagramChannel)c ).localAddress(); } throw new IllegalStateException("Does not have an InetSocketAddress"); }
/** * Return local server selector channel address. * * @return local {@link InetSocketAddress} */ default InetSocketAddress address(){ Channel c = channel(); if (c instanceof SocketChannel) { return ((SocketChannel) c).remoteAddress(); } if (c instanceof ServerSocketChannel) { return ((ServerSocketChannel) c).localAddress(); } if (c instanceof DatagramChannel) { InetSocketAddress a = ((DatagramChannel) c).remoteAddress(); return a != null ? a : ((DatagramChannel)c ).localAddress(); } throw new IllegalStateException("Does not have an InetSocketAddress"); }