mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8236925: (dc) Upgrade DatagramChannel socket adaptor to extend MulticastSocket
Reviewed-by: dfuchs
This commit is contained in:
parent
6ef474a4f4
commit
d4c3278889
7 changed files with 847 additions and 145 deletions
|
@ -29,6 +29,7 @@ import java.io.IOException;
|
|||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* The multicast datagram socket class is useful for sending
|
||||
* and receiving IP multicast packets. A MulticastSocket is
|
||||
|
@ -208,6 +209,10 @@ public class MulticastSocket extends DatagramSocket {
|
|||
public MulticastSocket(SocketAddress bindaddr) throws IOException {
|
||||
super((SocketAddress) null);
|
||||
|
||||
// No further initialization when this is a DatagramChannel socket adaptor
|
||||
if (this instanceof sun.nio.ch.DatagramSocketAdaptor)
|
||||
return;
|
||||
|
||||
// Enable SO_REUSEADDR before binding
|
||||
setReuseAddress(true);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue