< prev index next >
src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java
Print this page
rev 57580 : [mq]: MulticastSocketAdaptor
*** 1,7 ****
/*
! * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 1583,1592 ****
--- 1583,1608 ----
registry.remove(key);
}
}
/**
+ * Finds an existing membership of a multicast group. Returns null if this
+ * channel's socket is not a member of the group.
+ *
+ * @apiNote This method is for use by the socket adaptor
+ */
+ MembershipKey findMembership(InetAddress group, NetworkInterface interf) {
+ synchronized (stateLock) {
+ if (registry != null) {
+ return registry.checkMembership(group, interf, null);
+ } else {
+ return null;
+ }
+ }
+ }
+
+ /**
* Block datagrams from the given source.
*/
void block(MembershipKeyImpl key, InetAddress source)
throws IOException
{
< prev index next >