mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8244933: DatagramSocket.connect does not specify that it may cause datagrams in the socket receive buffer to be discarded
This fix updates the javadoc for `DatagramSocket.connect` to inform the user that it may cause datagrams in the socket receive buffer to be discarded if not previously received via a call to `DatagramSocket.receive`. Reviewed-by: alanb, dfuchs
This commit is contained in:
parent
c4985fb868
commit
2e8356ea40
1 changed files with 8 additions and 2 deletions
|
@ -312,7 +312,10 @@ public class DatagramSocket implements java.io.Closeable {
|
||||||
* operation, if the packet's address is set and the packet's address
|
* operation, if the packet's address is set and the packet's address
|
||||||
* and the socket's address do not match, an {@code IllegalArgumentException}
|
* and the socket's address do not match, an {@code IllegalArgumentException}
|
||||||
* will be thrown. A socket connected to a multicast address may only
|
* will be thrown. A socket connected to a multicast address may only
|
||||||
* be used to send packets.
|
* be used to send packets. Datagrams in the socket's {@linkplain
|
||||||
|
* java.net.StandardSocketOptions#SO_RCVBUF socket receive buffer}, which
|
||||||
|
* have not been {@linkplain #receive(DatagramPacket) received} before invoking
|
||||||
|
* this method, may be discarded.
|
||||||
*
|
*
|
||||||
* @param address the remote address for the socket
|
* @param address the remote address for the socket
|
||||||
*
|
*
|
||||||
|
@ -345,7 +348,10 @@ public class DatagramSocket implements java.io.Closeable {
|
||||||
* behaves as if invoking {@link #connect(InetAddress,int) connect(InetAddress,int)}
|
* behaves as if invoking {@link #connect(InetAddress,int) connect(InetAddress,int)}
|
||||||
* with the given socket addresses IP address and port number, except that the
|
* with the given socket addresses IP address and port number, except that the
|
||||||
* {@code SocketException} that may be raised is not wrapped in an
|
* {@code SocketException} that may be raised is not wrapped in an
|
||||||
* {@code UncheckedIOException}.
|
* {@code UncheckedIOException}. Datagrams in the socket's {@linkplain
|
||||||
|
* java.net.StandardSocketOptions#SO_RCVBUF socket receive buffer}, which
|
||||||
|
* have not been {@linkplain #receive(DatagramPacket) received} before invoking
|
||||||
|
* this method, may be discarded.
|
||||||
*
|
*
|
||||||
* @param addr The remote address.
|
* @param addr The remote address.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue