mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8243408: Inconsistent Exceptions are thrown by MulticastSocket when sending a DatagramPacket to port 0
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
This commit is contained in:
parent
2785fe5621
commit
42d2a7411b
4 changed files with 146 additions and 6 deletions
|
@ -797,6 +797,9 @@ public class MulticastSocket extends DatagramSocket {
|
|||
// set the ttl
|
||||
getImpl().setTTL(ttl);
|
||||
}
|
||||
if (packetPort == 0) {
|
||||
throw new SocketException("Can't send to port 0");
|
||||
}
|
||||
// call the datagram method to send
|
||||
getImpl().send(p);
|
||||
} finally {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue