Add DatagramChannel.isConnected()
.. because there is no way for a user with isActive to know if DatagramChannel is connected or not
This commit is contained in:
parent
a5bb2c7f77
commit
81eaea77bd
@ -35,6 +35,8 @@ public interface DatagramChannel extends Channel {
|
||||
@Override
|
||||
InetSocketAddress remoteAddress();
|
||||
|
||||
boolean isConnected();
|
||||
|
||||
/**
|
||||
* Joins a multicast group.
|
||||
*/
|
||||
|
@ -112,6 +112,11 @@ public final class NioDatagramChannel
|
||||
return ch.isOpen() && ch.socket().isBound();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected() {
|
||||
return javaChannel().isConnected();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DatagramChannel javaChannel() {
|
||||
return (DatagramChannel) super.javaChannel();
|
||||
|
@ -109,6 +109,11 @@ public class OioDatagramChannel extends AbstractOioMessageChannel
|
||||
return isOpen() && socket.isBound();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected() {
|
||||
return socket.isConnected();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SocketAddress localAddress0() {
|
||||
return socket.getLocalSocketAddress();
|
||||
|
Loading…
Reference in New Issue
Block a user