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
9ec51d01d6
commit
f60a6e861c
@ -35,6 +35,8 @@ public interface DatagramChannel extends Channel {
|
|||||||
@Override
|
@Override
|
||||||
InetSocketAddress remoteAddress();
|
InetSocketAddress remoteAddress();
|
||||||
|
|
||||||
|
boolean isConnected();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joins a multicast group.
|
* Joins a multicast group.
|
||||||
*/
|
*/
|
||||||
|
@ -112,6 +112,11 @@ public final class NioDatagramChannel
|
|||||||
return ch.isOpen() && ch.socket().isBound();
|
return ch.isOpen() && ch.socket().isBound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isConnected() {
|
||||||
|
return javaChannel().isConnected();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DatagramChannel javaChannel() {
|
protected DatagramChannel javaChannel() {
|
||||||
return (DatagramChannel) super.javaChannel();
|
return (DatagramChannel) super.javaChannel();
|
||||||
|
@ -109,6 +109,11 @@ public class OioDatagramChannel extends AbstractOioMessageChannel
|
|||||||
return isOpen() && socket.isBound();
|
return isOpen() && socket.isBound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isConnected() {
|
||||||
|
return socket.isConnected();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SocketAddress localAddress0() {
|
protected SocketAddress localAddress0() {
|
||||||
return socket.getLocalSocketAddress();
|
return socket.getLocalSocketAddress();
|
||||||
|
Loading…
Reference in New Issue
Block a user