public ChannelFuture joinGroup ( InetAddress multicastAddress , NetworkInterface networkInterface , InetAddress source ) { if ( DetectionUtil . javaVersion ( ) < 7 ) { throw new UnsupportedOperationException ( ) ; } if ( multicastAddress == null ) { throw new NullPointerException ( "multicastAddress" ) ; } if ( networkInterface == null ) { throw new NullPointerException ( "networkInterface" ) ; } try { MembershipKey key ; if ( source == null ) { key = channel . join ( multicastAddress , networkInterface ) ; } else { key = channel . join ( multicastAddress , networkInterface , source ) ; } synchronized ( this ) { if ( memberships == null ) { memberships = new HashMap < InetAddress , List < MembershipKey > > ( ) ; } List < MembershipKey > keys = memberships . get ( multicastAddress ) ; if ( keys == null ) { keys = new ArrayList < MembershipKey > ( ) ; memberships . put ( multicastAddress , keys ) ; } keys . add ( key ) ; } } catch ( Throwable e ) { return failedFuture ( this , e ) ; } return succeededFuture ( this ) ; }
Joins the specified multicast group at the specified interface using the specified source .