This fix clarifies the behaviours of constructors from DatagramSocket and MulticastSocket when no address or a null address is supplied.
Reviewed-by: dfuchs
Replace the underlying implementations of the java.net.DatagramSocket and java.net.MulticastSocket APIs with simpler and more modern implementations that are easy to maintain and debug.
Co-authored-by: Alan Bateman <alan.bateman@oracle.com>
Co-authored-by: Chris Hegarty <chris.hegarty@oracle.com>
Co-authored-by: Daniel Fuchs <daniel.fuchs@oracle.com>
Reviewed-by: alanb, chegar, dfuchs
This fix adds a check for port == 0 to MulticastSocket's 2-arg send method to ensure a consistent exception is thrown across platforms
Reviewed-by: dfuchs
DatagramSocket and MulticastSocket changed to throw IllegalArgumentException if not connected and passed a packet containing a port out of range
Reviewed-by: chegar, dfuchs
Methods from DatagramSocket and MulticastSocket added in JDK1.2 do not have their @since tags. This fix adds them in
Reviewed-by: alanb, chegar, dfuchs
Clarifies the behaviour of 2-arg joinGroup/leaveGroup methods when null is passed for the NetworkInteface argument. The fix also clarifies what is returned by getInterface() and getNetworkInterface() methods when no previous NetworkInterface has been set.
Reviewed-by: alanb, chegar, dfuchs
The MulticastSocket method getOption has been changed to conform to the behavior described in StandardSocketOptions.IP_MULTICAST_IF.
Reviewed-by: chegar, dfuchs
DatagramSocket and MulticastSocket send methods are changed to throw IllegalArgumentException if no target address can be determined.
Reviewed-by: alanb
Sample code shows that String.length() can be passed to a DatagramPacket along with String.getBytes(), but is incorrect for non-ASCII Strings.
Reviewed-by: martin, chegar