mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
7042979: Rename StandardSocketOption and StandardWatchEventKind
Reviewed-by: forax, chegar
This commit is contained in:
parent
66f7633b48
commit
914105d32e
63 changed files with 261 additions and 261 deletions
|
@ -38,7 +38,7 @@ FILES_java = \
|
||||||
com/sun/nio/sctp/SctpMultiChannel.java \
|
com/sun/nio/sctp/SctpMultiChannel.java \
|
||||||
com/sun/nio/sctp/SctpServerChannel.java \
|
com/sun/nio/sctp/SctpServerChannel.java \
|
||||||
com/sun/nio/sctp/SctpSocketOption.java \
|
com/sun/nio/sctp/SctpSocketOption.java \
|
||||||
com/sun/nio/sctp/SctpStandardSocketOption.java \
|
com/sun/nio/sctp/SctpStandardSocketOptions.java \
|
||||||
com/sun/nio/sctp/SendFailedNotification.java \
|
com/sun/nio/sctp/SendFailedNotification.java \
|
||||||
com/sun/nio/sctp/ShutdownNotification.java \
|
com/sun/nio/sctp/ShutdownNotification.java \
|
||||||
\
|
\
|
||||||
|
|
|
@ -116,7 +116,7 @@ FILES_src = \
|
||||||
java/nio/file/SimpleFileVisitor.java \
|
java/nio/file/SimpleFileVisitor.java \
|
||||||
java/nio/file/StandardCopyOption.java \
|
java/nio/file/StandardCopyOption.java \
|
||||||
java/nio/file/StandardOpenOption.java \
|
java/nio/file/StandardOpenOption.java \
|
||||||
java/nio/file/StandardWatchEventKind.java \
|
java/nio/file/StandardWatchEventKinds.java \
|
||||||
java/nio/file/TempFileHelper.java \
|
java/nio/file/TempFileHelper.java \
|
||||||
java/nio/file/WatchEvent.java \
|
java/nio/file/WatchEvent.java \
|
||||||
java/nio/file/WatchKey.java \
|
java/nio/file/WatchKey.java \
|
||||||
|
|
|
@ -179,7 +179,7 @@ public abstract class MessageInfo {
|
||||||
* completely received. For messages being sent {@code true} indicates that
|
* completely received. For messages being sent {@code true} indicates that
|
||||||
* the message is complete, {@code false} indicates that the message is not
|
* the message is complete, {@code false} indicates that the message is not
|
||||||
* complete. How the send channel interprets this value depends on the value
|
* complete. How the send channel interprets this value depends on the value
|
||||||
* of its {@link SctpStandardSocketOption#SCTP_EXPLICIT_COMPLETE
|
* of its {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE
|
||||||
* SCTP_EXPLICIT_COMPLETE} socket option.
|
* SCTP_EXPLICIT_COMPLETE} socket option.
|
||||||
*
|
*
|
||||||
* @return {@code true} if, and only if, the message is complete
|
* @return {@code true} if, and only if, the message is complete
|
||||||
|
@ -192,7 +192,7 @@ public abstract class MessageInfo {
|
||||||
* <P> For messages being sent {@code true} indicates that
|
* <P> For messages being sent {@code true} indicates that
|
||||||
* the message is complete, {@code false} indicates that the message is not
|
* the message is complete, {@code false} indicates that the message is not
|
||||||
* complete. How the send channel interprets this value depends on the value
|
* complete. How the send channel interprets this value depends on the value
|
||||||
* of its {@link SctpStandardSocketOption#SCTP_EXPLICIT_COMPLETE
|
* of its {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE
|
||||||
* SCTP_EXPLICIT_COMPLETE} socket option.
|
* SCTP_EXPLICIT_COMPLETE} socket option.
|
||||||
*
|
*
|
||||||
* @param complete
|
* @param complete
|
||||||
|
|
|
@ -65,55 +65,55 @@ import java.nio.channels.SelectionKey;
|
||||||
* <th>Description</th>
|
* <th>Description</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_DISABLE_FRAGMENTS
|
* <td> {@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS
|
||||||
* SCTP_DISABLE_FRAGMENTS} </td>
|
* SCTP_DISABLE_FRAGMENTS} </td>
|
||||||
* <td> Enables or disables message fragmentation </td>
|
* <td> Enables or disables message fragmentation </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_EXPLICIT_COMPLETE
|
* <td> {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE
|
||||||
* SCTP_EXPLICIT_COMPLETE} </td>
|
* SCTP_EXPLICIT_COMPLETE} </td>
|
||||||
* <td> Enables or disables explicit message completion </td>
|
* <td> Enables or disables explicit message completion </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_FRAGMENT_INTERLEAVE
|
* <td> {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE
|
||||||
* SCTP_FRAGMENT_INTERLEAVE} </td>
|
* SCTP_FRAGMENT_INTERLEAVE} </td>
|
||||||
* <td> Controls how the presentation of messages occur for the message
|
* <td> Controls how the presentation of messages occur for the message
|
||||||
* receiver </td>
|
* receiver </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_INIT_MAXSTREAMS
|
* <td> {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS
|
||||||
* SCTP_INIT_MAXSTREAMS} </td>
|
* SCTP_INIT_MAXSTREAMS} </td>
|
||||||
* <td> The maximum number of streams requested by the local endpoint during
|
* <td> The maximum number of streams requested by the local endpoint during
|
||||||
* association initialization </td>
|
* association initialization </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_NODELAY SCTP_NODELAY} </td>
|
* <td> {@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} </td>
|
||||||
* <td> Enables or disable a Nagle-like algorithm </td>
|
* <td> Enables or disable a Nagle-like algorithm </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_PRIMARY_ADDR
|
* <td> {@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR
|
||||||
* SCTP_PRIMARY_ADDR} </td>
|
* SCTP_PRIMARY_ADDR} </td>
|
||||||
* <td> Requests that the local SCTP stack use the given peer address as the
|
* <td> Requests that the local SCTP stack use the given peer address as the
|
||||||
* association primary </td>
|
* association primary </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_SET_PEER_PRIMARY_ADDR
|
* <td> {@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR
|
||||||
* SCTP_SET_PEER_PRIMARY_ADDR} </td>
|
* SCTP_SET_PEER_PRIMARY_ADDR} </td>
|
||||||
* <td> Requests that the peer mark the enclosed address as the association
|
* <td> Requests that the peer mark the enclosed address as the association
|
||||||
* primary </td>
|
* primary </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SO_SNDBUF
|
* <td> {@link SctpStandardSocketOptions#SO_SNDBUF
|
||||||
* SO_SNDBUF} </td>
|
* SO_SNDBUF} </td>
|
||||||
* <td> The size of the socket send buffer </td>
|
* <td> The size of the socket send buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SO_RCVBUF
|
* <td> {@link SctpStandardSocketOptions#SO_RCVBUF
|
||||||
* SO_RCVBUF} </td>
|
* SO_RCVBUF} </td>
|
||||||
* <td> The size of the socket receive buffer </td>
|
* <td> The size of the socket receive buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SO_LINGER
|
* <td> {@link SctpStandardSocketOptions#SO_LINGER
|
||||||
* SO_LINGER} </td>
|
* SO_LINGER} </td>
|
||||||
* <td> Linger on close if data is present (when configured in blocking mode
|
* <td> Linger on close if data is present (when configured in blocking mode
|
||||||
* only) </td>
|
* only) </td>
|
||||||
|
@ -449,7 +449,7 @@ public abstract class SctpChannel
|
||||||
* <P> This is a convience method and is equivalent to evaluating the
|
* <P> This is a convience method and is equivalent to evaluating the
|
||||||
* following expression:
|
* following expression:
|
||||||
* <blockquote><pre>
|
* <blockquote><pre>
|
||||||
* setOption(SctpStandardSocketOption.SCTP_INIT_MAXSTREAMS, SctpStandardSocketOption.InitMaxStreams.create(maxInStreams, maxOutStreams))
|
* setOption(SctpStandardSocketOptions.SCTP_INIT_MAXSTREAMS, SctpStandardSocketOption.InitMaxStreams.create(maxInStreams, maxOutStreams))
|
||||||
* .connect(remote);
|
* .connect(remote);
|
||||||
* </pre></blockquote>
|
* </pre></blockquote>
|
||||||
*
|
*
|
||||||
|
@ -651,7 +651,7 @@ public abstract class SctpChannel
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* If an I/O error occurs
|
* If an I/O error occurs
|
||||||
*
|
*
|
||||||
* @see SctpStandardSocketOption
|
* @see SctpStandardSocketOptions
|
||||||
*/
|
*/
|
||||||
public abstract <T> T getOption(SctpSocketOption<T> name)
|
public abstract <T> T getOption(SctpSocketOption<T> name)
|
||||||
throws IOException;
|
throws IOException;
|
||||||
|
@ -680,7 +680,7 @@ public abstract class SctpChannel
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* If an I/O error occurs
|
* If an I/O error occurs
|
||||||
*
|
*
|
||||||
* @see SctpStandardSocketOption
|
* @see SctpStandardSocketOptions
|
||||||
*/
|
*/
|
||||||
public abstract <T> SctpChannel setOption(SctpSocketOption<T> name, T value)
|
public abstract <T> SctpChannel setOption(SctpSocketOption<T> name, T value)
|
||||||
throws IOException;
|
throws IOException;
|
||||||
|
@ -731,7 +731,7 @@ public abstract class SctpChannel
|
||||||
* MessageInfo} will return {@code false}, and more invocations of this
|
* MessageInfo} will return {@code false}, and more invocations of this
|
||||||
* method will be necessary to completely consume the messgae. Only
|
* method will be necessary to completely consume the messgae. Only
|
||||||
* one message at a time will be partially delivered in any stream. The
|
* one message at a time will be partially delivered in any stream. The
|
||||||
* socket option {@link SctpStandardSocketOption#SCTP_FRAGMENT_INTERLEAVE
|
* socket option {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE
|
||||||
* SCTP_FRAGMENT_INTERLEAVE} controls various aspects of what interlacing of
|
* SCTP_FRAGMENT_INTERLEAVE} controls various aspects of what interlacing of
|
||||||
* messages occurs.
|
* messages occurs.
|
||||||
*
|
*
|
||||||
|
@ -804,7 +804,7 @@ public abstract class SctpChannel
|
||||||
* and sufficient room becomes available, then the remaining bytes in the
|
* and sufficient room becomes available, then the remaining bytes in the
|
||||||
* given byte buffer are transmitted as a single message. Sending a message
|
* given byte buffer are transmitted as a single message. Sending a message
|
||||||
* is atomic unless explicit message completion {@link
|
* is atomic unless explicit message completion {@link
|
||||||
* SctpStandardSocketOption#SCTP_EXPLICIT_COMPLETE SCTP_EXPLICIT_COMPLETE}
|
* SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE SCTP_EXPLICIT_COMPLETE}
|
||||||
* socket option is enabled on this channel's socket.
|
* socket option is enabled on this channel's socket.
|
||||||
*
|
*
|
||||||
* <P> The message is transferred from the byte buffer as if by a regular
|
* <P> The message is transferred from the byte buffer as if by a regular
|
||||||
|
|
|
@ -69,55 +69,55 @@ import java.nio.channels.SelectionKey;
|
||||||
* <th>Description</th>
|
* <th>Description</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_DISABLE_FRAGMENTS
|
* <td> {@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS
|
||||||
* SCTP_DISABLE_FRAGMENTS} </td>
|
* SCTP_DISABLE_FRAGMENTS} </td>
|
||||||
* <td> Enables or disables message fragmentation </td>
|
* <td> Enables or disables message fragmentation </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_EXPLICIT_COMPLETE
|
* <td> {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE
|
||||||
* SCTP_EXPLICIT_COMPLETE} </td>
|
* SCTP_EXPLICIT_COMPLETE} </td>
|
||||||
* <td> Enables or disables explicit message completion </td>
|
* <td> Enables or disables explicit message completion </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_FRAGMENT_INTERLEAVE
|
* <td> {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE
|
||||||
* SCTP_FRAGMENT_INTERLEAVE} </td>
|
* SCTP_FRAGMENT_INTERLEAVE} </td>
|
||||||
* <td> Controls how the presentation of messages occur for the message
|
* <td> Controls how the presentation of messages occur for the message
|
||||||
* receiver </td>
|
* receiver </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_INIT_MAXSTREAMS
|
* <td> {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS
|
||||||
* SCTP_INIT_MAXSTREAMS} </td>
|
* SCTP_INIT_MAXSTREAMS} </td>
|
||||||
* <td> The maximum number of streams requested by the local endpoint during
|
* <td> The maximum number of streams requested by the local endpoint during
|
||||||
* association initialization </td>
|
* association initialization </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_NODELAY SCTP_NODELAY} </td>
|
* <td> {@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} </td>
|
||||||
* <td> Enables or disable a Nagle-like algorithm </td>
|
* <td> Enables or disable a Nagle-like algorithm </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_PRIMARY_ADDR
|
* <td> {@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR
|
||||||
* SCTP_PRIMARY_ADDR} </td>
|
* SCTP_PRIMARY_ADDR} </td>
|
||||||
* <td> Requests that the local SCTP stack use the given peer address as the
|
* <td> Requests that the local SCTP stack use the given peer address as the
|
||||||
* association primary </td>
|
* association primary </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_SET_PEER_PRIMARY_ADDR
|
* <td> {@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR
|
||||||
* SCTP_SET_PEER_PRIMARY_ADDR} </td>
|
* SCTP_SET_PEER_PRIMARY_ADDR} </td>
|
||||||
* <td> Requests that the peer mark the enclosed address as the association
|
* <td> Requests that the peer mark the enclosed address as the association
|
||||||
* primary </td>
|
* primary </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SO_SNDBUF
|
* <td> {@link SctpStandardSocketOptions#SO_SNDBUF
|
||||||
* SO_SNDBUF} </td>
|
* SO_SNDBUF} </td>
|
||||||
* <td> The size of the socket send buffer </td>
|
* <td> The size of the socket send buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SO_RCVBUF
|
* <td> {@link SctpStandardSocketOptions#SO_RCVBUF
|
||||||
* SO_RCVBUF} </td>
|
* SO_RCVBUF} </td>
|
||||||
* <td> The size of the socket receive buffer </td>
|
* <td> The size of the socket receive buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SO_LINGER
|
* <td> {@link SctpStandardSocketOptions#SO_LINGER
|
||||||
* SO_LINGER} </td>
|
* SO_LINGER} </td>
|
||||||
* <td> Linger on close if data is present (when configured in blocking mode
|
* <td> Linger on close if data is present (when configured in blocking mode
|
||||||
* only) </td>
|
* only) </td>
|
||||||
|
@ -450,7 +450,7 @@ public abstract class SctpMultiChannel
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* If an I/O error occurs
|
* If an I/O error occurs
|
||||||
*
|
*
|
||||||
* @see SctpStandardSocketOption
|
* @see SctpStandardSocketOptions
|
||||||
*/
|
*/
|
||||||
public abstract <T> T getOption(SctpSocketOption<T> name,
|
public abstract <T> T getOption(SctpSocketOption<T> name,
|
||||||
Association association)
|
Association association)
|
||||||
|
@ -489,7 +489,7 @@ public abstract class SctpMultiChannel
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* If an I/O error occurs
|
* If an I/O error occurs
|
||||||
*
|
*
|
||||||
* @see SctpStandardSocketOption
|
* @see SctpStandardSocketOptions
|
||||||
*/
|
*/
|
||||||
public abstract <T> SctpMultiChannel setOption(SctpSocketOption<T> name,
|
public abstract <T> SctpMultiChannel setOption(SctpSocketOption<T> name,
|
||||||
T value,
|
T value,
|
||||||
|
@ -542,7 +542,7 @@ public abstract class SctpMultiChannel
|
||||||
* MessageInfo} will return {@code false}, and more invocations of this
|
* MessageInfo} will return {@code false}, and more invocations of this
|
||||||
* method will be necessary to completely consume the messgae. Only
|
* method will be necessary to completely consume the messgae. Only
|
||||||
* one message at a time will be partially delivered in any stream. The
|
* one message at a time will be partially delivered in any stream. The
|
||||||
* socket option {@link SctpStandardSocketOption#SCTP_FRAGMENT_INTERLEAVE
|
* socket option {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE
|
||||||
* SCTP_FRAGMENT_INTERLEAVE} controls various aspects of what interlacing of
|
* SCTP_FRAGMENT_INTERLEAVE} controls various aspects of what interlacing of
|
||||||
* messages occurs.
|
* messages occurs.
|
||||||
*
|
*
|
||||||
|
@ -635,14 +635,14 @@ public abstract class SctpMultiChannel
|
||||||
* underlying output buffer, then the remaining bytes in the given byte
|
* underlying output buffer, then the remaining bytes in the given byte
|
||||||
* buffer are transmitted as a single message. Sending a message
|
* buffer are transmitted as a single message. Sending a message
|
||||||
* is atomic unless explicit message completion {@link
|
* is atomic unless explicit message completion {@link
|
||||||
* SctpStandardSocketOption#SCTP_EXPLICIT_COMPLETE SCTP_EXPLICIT_COMPLETE}
|
* SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE SCTP_EXPLICIT_COMPLETE}
|
||||||
* socket option is enabled on this channel's socket.
|
* socket option is enabled on this channel's socket.
|
||||||
*
|
*
|
||||||
* <P> If this channel is in non-blocking mode, there is sufficient room
|
* <P> If this channel is in non-blocking mode, there is sufficient room
|
||||||
* in the underlying output buffer, and an implicit association setup is
|
* in the underlying output buffer, and an implicit association setup is
|
||||||
* required, then the remaining bytes in the given byte buffer are
|
* required, then the remaining bytes in the given byte buffer are
|
||||||
* transmitted as a single message, subject to {@link
|
* transmitted as a single message, subject to {@link
|
||||||
* SctpStandardSocketOption#SCTP_EXPLICIT_COMPLETE SCTP_EXPLICIT_COMPLETE}.
|
* SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE SCTP_EXPLICIT_COMPLETE}.
|
||||||
* If for any reason the message cannot
|
* If for any reason the message cannot
|
||||||
* be delivered an {@link AssociationChangeNotification association
|
* be delivered an {@link AssociationChangeNotification association
|
||||||
* changed} notification is put on the SCTP stack with its {@code event} parameter set
|
* changed} notification is put on the SCTP stack with its {@code event} parameter set
|
||||||
|
|
|
@ -53,7 +53,7 @@ import java.nio.channels.spi.AbstractSelectableChannel;
|
||||||
* <th>Description</th>
|
* <th>Description</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link SctpStandardSocketOption#SCTP_INIT_MAXSTREAMS
|
* <td> {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS
|
||||||
* SCTP_INIT_MAXSTREAMS} </td>
|
* SCTP_INIT_MAXSTREAMS} </td>
|
||||||
* <td> The maximum number of streams requested by the local endpoint during
|
* <td> The maximum number of streams requested by the local endpoint during
|
||||||
* association initialization </td>
|
* association initialization </td>
|
||||||
|
@ -360,7 +360,7 @@ public abstract class SctpServerChannel
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* If an I/O error occurs
|
* If an I/O error occurs
|
||||||
*
|
*
|
||||||
* @see SctpStandardSocketOption
|
* @see SctpStandardSocketOptions
|
||||||
*/
|
*/
|
||||||
public abstract <T> T getOption(SctpSocketOption<T> name) throws IOException;
|
public abstract <T> T getOption(SctpSocketOption<T> name) throws IOException;
|
||||||
|
|
||||||
|
@ -388,7 +388,7 @@ public abstract class SctpServerChannel
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* If an I/O error occurs
|
* If an I/O error occurs
|
||||||
*
|
*
|
||||||
* @see SctpStandardSocketOption
|
* @see SctpStandardSocketOptions
|
||||||
*/
|
*/
|
||||||
public abstract <T> SctpServerChannel setOption(SctpSocketOption<T> name,
|
public abstract <T> SctpServerChannel setOption(SctpSocketOption<T> name,
|
||||||
T value)
|
T value)
|
||||||
|
|
|
@ -33,6 +33,6 @@ import java.net.SocketOption;
|
||||||
*
|
*
|
||||||
* @since 1.7
|
* @since 1.7
|
||||||
*
|
*
|
||||||
* @see SctpStandardSocketOption
|
* @see SctpStandardSocketOptions
|
||||||
*/
|
*/
|
||||||
public interface SctpSocketOption<T> extends SocketOption<T> { }
|
public interface SctpSocketOption<T> extends SocketOption<T> { }
|
||||||
|
|
|
@ -34,8 +34,8 @@ import sun.nio.ch.SctpStdSocketOption;
|
||||||
*
|
*
|
||||||
* @since 1.7
|
* @since 1.7
|
||||||
*/
|
*/
|
||||||
public class SctpStandardSocketOption {
|
public class SctpStandardSocketOptions {
|
||||||
private SctpStandardSocketOption() {}
|
private SctpStandardSocketOptions() {}
|
||||||
/**
|
/**
|
||||||
* Enables or disables message fragmentation.
|
* Enables or disables message fragmentation.
|
||||||
*
|
*
|
||||||
|
@ -127,7 +127,7 @@ public class SctpStandardSocketOption {
|
||||||
* association initialization.
|
* association initialization.
|
||||||
*
|
*
|
||||||
* <P> The value of this socket option is an {@link
|
* <P> The value of this socket option is an {@link
|
||||||
* SctpStandardSocketOption.InitMaxStreams InitMaxStreams}, that represents
|
* SctpStandardSocketOptions.InitMaxStreams InitMaxStreams}, that represents
|
||||||
* the maximum number of inbound and outbound streams that an association
|
* the maximum number of inbound and outbound streams that an association
|
||||||
* on the channel is prepared to support.
|
* on the channel is prepared to support.
|
||||||
*
|
*
|
||||||
|
@ -157,9 +157,9 @@ public class SctpStandardSocketOption {
|
||||||
* the endpoints default value.
|
* the endpoints default value.
|
||||||
*/
|
*/
|
||||||
public static final SctpSocketOption
|
public static final SctpSocketOption
|
||||||
<SctpStandardSocketOption.InitMaxStreams> SCTP_INIT_MAXSTREAMS =
|
<SctpStandardSocketOptions.InitMaxStreams> SCTP_INIT_MAXSTREAMS =
|
||||||
new SctpStdSocketOption<SctpStandardSocketOption.InitMaxStreams>(
|
new SctpStdSocketOption<SctpStandardSocketOptions.InitMaxStreams>(
|
||||||
"SCTP_INIT_MAXSTREAMS", SctpStandardSocketOption.InitMaxStreams.class);
|
"SCTP_INIT_MAXSTREAMS", SctpStandardSocketOptions.InitMaxStreams.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables or disables a Nagle-like algorithm.
|
* Enables or disables a Nagle-like algorithm.
|
||||||
|
@ -310,7 +310,7 @@ public class SctpStandardSocketOption {
|
||||||
* This class is used to set the maximum number of inbound/outbound streams
|
* This class is used to set the maximum number of inbound/outbound streams
|
||||||
* used by the local endpoint during association initialization. An
|
* used by the local endpoint during association initialization. An
|
||||||
* instance of this class is used to set the {@link
|
* instance of this class is used to set the {@link
|
||||||
* SctpStandardSocketOption#SCTP_INIT_MAXSTREAMS SCTP_INIT_MAXSTREAMS}
|
* SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS SCTP_INIT_MAXSTREAMS}
|
||||||
* socket option.
|
* socket option.
|
||||||
*
|
*
|
||||||
* @since 1.7
|
* @since 1.7
|
|
@ -38,7 +38,7 @@ package java.net;
|
||||||
*
|
*
|
||||||
* @since 1.7
|
* @since 1.7
|
||||||
*
|
*
|
||||||
* @see StandardSocketOption
|
* @see StandardSocketOptions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface SocketOption<T> {
|
public interface SocketOption<T> {
|
||||||
|
|
|
@ -38,8 +38,8 @@ package java.net;
|
||||||
* @since 1.7
|
* @since 1.7
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public final class StandardSocketOption {
|
public final class StandardSocketOptions {
|
||||||
private StandardSocketOption() { }
|
private StandardSocketOptions() { }
|
||||||
|
|
||||||
// -- SOL_SOCKET --
|
// -- SOL_SOCKET --
|
||||||
|
|
|
@ -58,11 +58,11 @@ import java.io.IOException;
|
||||||
* <th>Description</th>
|
* <th>Description</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_RCVBUF SO_RCVBUF} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} </td>
|
||||||
* <td> The size of the socket receive buffer </td>
|
* <td> The size of the socket receive buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_REUSEADDR SO_REUSEADDR} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} </td>
|
||||||
* <td> Re-use address </td>
|
* <td> Re-use address </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* </table>
|
* </table>
|
||||||
|
|
|
@ -68,23 +68,23 @@ import java.nio.ByteBuffer;
|
||||||
* <th>Description</th>
|
* <th>Description</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_SNDBUF SO_SNDBUF} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} </td>
|
||||||
* <td> The size of the socket send buffer </td>
|
* <td> The size of the socket send buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_RCVBUF SO_RCVBUF} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} </td>
|
||||||
* <td> The size of the socket receive buffer </td>
|
* <td> The size of the socket receive buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_KEEPALIVE SO_KEEPALIVE} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} </td>
|
||||||
* <td> Keep connection alive </td>
|
* <td> Keep connection alive </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_REUSEADDR SO_REUSEADDR} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} </td>
|
||||||
* <td> Re-use address </td>
|
* <td> Re-use address </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#TCP_NODELAY TCP_NODELAY} </td>
|
* <td> {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} </td>
|
||||||
* <td> Disable the Nagle algorithm </td>
|
* <td> Disable the Nagle algorithm </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* </table>
|
* </table>
|
||||||
|
|
|
@ -63,37 +63,37 @@ import java.nio.channels.spi.SelectorProvider;
|
||||||
* <th>Description</th>
|
* <th>Description</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_SNDBUF SO_SNDBUF} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} </td>
|
||||||
* <td> The size of the socket send buffer </td>
|
* <td> The size of the socket send buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_RCVBUF SO_RCVBUF} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} </td>
|
||||||
* <td> The size of the socket receive buffer </td>
|
* <td> The size of the socket receive buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_REUSEADDR SO_REUSEADDR} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} </td>
|
||||||
* <td> Re-use address </td>
|
* <td> Re-use address </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_BROADCAST SO_BROADCAST} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_BROADCAST SO_BROADCAST} </td>
|
||||||
* <td> Allow transmission of broadcast datagrams </td>
|
* <td> Allow transmission of broadcast datagrams </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#IP_TOS IP_TOS} </td>
|
* <td> {@link java.net.StandardSocketOptions#IP_TOS IP_TOS} </td>
|
||||||
* <td> The Type of Service (ToS) octet in the Internet Protocol (IP) header </td>
|
* <td> The Type of Service (ToS) octet in the Internet Protocol (IP) header </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#IP_MULTICAST_IF IP_MULTICAST_IF} </td>
|
* <td> {@link java.net.StandardSocketOptions#IP_MULTICAST_IF IP_MULTICAST_IF} </td>
|
||||||
* <td> The network interface for Internet Protocol (IP) multicast datagrams </td>
|
* <td> The network interface for Internet Protocol (IP) multicast datagrams </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#IP_MULTICAST_TTL
|
* <td> {@link java.net.StandardSocketOptions#IP_MULTICAST_TTL
|
||||||
* IP_MULTICAST_TTL} </td>
|
* IP_MULTICAST_TTL} </td>
|
||||||
* <td> The <em>time-to-live</em> for Internet Protocol (IP) multicast
|
* <td> The <em>time-to-live</em> for Internet Protocol (IP) multicast
|
||||||
* datagrams </td>
|
* datagrams </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#IP_MULTICAST_LOOP
|
* <td> {@link java.net.StandardSocketOptions#IP_MULTICAST_LOOP
|
||||||
* IP_MULTICAST_LOOP} </td>
|
* IP_MULTICAST_LOOP} </td>
|
||||||
* <td> Loopback for Internet Protocol (IP) multicast datagrams </td>
|
* <td> Loopback for Internet Protocol (IP) multicast datagrams </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
|
|
|
@ -30,7 +30,7 @@ import java.net.NetworkInterface;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.ProtocolFamily; // javadoc
|
import java.net.ProtocolFamily; // javadoc
|
||||||
import java.net.StandardProtocolFamily; // javadoc
|
import java.net.StandardProtocolFamily; // javadoc
|
||||||
import java.net.StandardSocketOption; // javadoc
|
import java.net.StandardSocketOptions; // javadoc
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A network channel that supports Internet Protocol (IP) multicasting.
|
* A network channel that supports Internet Protocol (IP) multicasting.
|
||||||
|
@ -93,7 +93,7 @@ import java.net.StandardSocketOption; // javadoc
|
||||||
* a specific address, rather than the wildcard address then it is implementation
|
* a specific address, rather than the wildcard address then it is implementation
|
||||||
* specific if multicast datagrams are received by the socket. </p></li>
|
* specific if multicast datagrams are received by the socket. </p></li>
|
||||||
*
|
*
|
||||||
* <li><p> The {@link StandardSocketOption#SO_REUSEADDR SO_REUSEADDR} option should be
|
* <li><p> The {@link StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} option should be
|
||||||
* enabled prior to {@link NetworkChannel#bind binding} the socket. This is
|
* enabled prior to {@link NetworkChannel#bind binding} the socket. This is
|
||||||
* required to allow multiple members of the group to bind to the same
|
* required to allow multiple members of the group to bind to the same
|
||||||
* address. </p></li>
|
* address. </p></li>
|
||||||
|
@ -107,9 +107,9 @@ import java.net.StandardSocketOption; // javadoc
|
||||||
* NetworkInterface ni = NetworkInterface.getByName("hme0");
|
* NetworkInterface ni = NetworkInterface.getByName("hme0");
|
||||||
*
|
*
|
||||||
* DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)
|
* DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)
|
||||||
* .setOption(StandardSocketOption.SO_REUSEADDR, true)
|
* .setOption(StandardSocketOptions.SO_REUSEADDR, true)
|
||||||
* .bind(new InetSocketAddress(5000))
|
* .bind(new InetSocketAddress(5000))
|
||||||
* .setOption(StandardSocketOption.IP_MULTICAST_IF, ni);
|
* .setOption(StandardSocketOptions.IP_MULTICAST_IF, ni);
|
||||||
*
|
*
|
||||||
* InetAddress group = InetAddress.getByName("225.4.5.6");
|
* InetAddress group = InetAddress.getByName("225.4.5.6");
|
||||||
*
|
*
|
||||||
|
|
|
@ -124,7 +124,7 @@ public interface NetworkChannel
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* If an I/O error occurs
|
* If an I/O error occurs
|
||||||
*
|
*
|
||||||
* @see java.net.StandardSocketOption
|
* @see java.net.StandardSocketOptions
|
||||||
*/
|
*/
|
||||||
<T> NetworkChannel setOption(SocketOption<T> name, T value) throws IOException;
|
<T> NetworkChannel setOption(SocketOption<T> name, T value) throws IOException;
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ public interface NetworkChannel
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* If an I/O error occurs
|
* If an I/O error occurs
|
||||||
*
|
*
|
||||||
* @see java.net.StandardSocketOption
|
* @see java.net.StandardSocketOptions
|
||||||
*/
|
*/
|
||||||
<T> T getOption(SocketOption<T> name) throws IOException;
|
<T> T getOption(SocketOption<T> name) throws IOException;
|
||||||
|
|
||||||
|
|
|
@ -52,11 +52,11 @@ import java.nio.channels.spi.SelectorProvider;
|
||||||
* <th>Description</th>
|
* <th>Description</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_RCVBUF SO_RCVBUF} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} </td>
|
||||||
* <td> The size of the socket receive buffer </td>
|
* <td> The size of the socket receive buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_REUSEADDR SO_REUSEADDR} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} </td>
|
||||||
* <td> Re-use address </td>
|
* <td> Re-use address </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* </table>
|
* </table>
|
||||||
|
|
|
@ -72,28 +72,28 @@ import java.nio.channels.spi.SelectorProvider;
|
||||||
* <th>Description</th>
|
* <th>Description</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_SNDBUF SO_SNDBUF} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} </td>
|
||||||
* <td> The size of the socket send buffer </td>
|
* <td> The size of the socket send buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_RCVBUF SO_RCVBUF} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} </td>
|
||||||
* <td> The size of the socket receive buffer </td>
|
* <td> The size of the socket receive buffer </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_KEEPALIVE SO_KEEPALIVE} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_KEEPALIVE SO_KEEPALIVE} </td>
|
||||||
* <td> Keep connection alive </td>
|
* <td> Keep connection alive </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_REUSEADDR SO_REUSEADDR} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} </td>
|
||||||
* <td> Re-use address </td>
|
* <td> Re-use address </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#SO_LINGER SO_LINGER} </td>
|
* <td> {@link java.net.StandardSocketOptions#SO_LINGER SO_LINGER} </td>
|
||||||
* <td> Linger on close if data is present (when configured in blocking mode
|
* <td> Linger on close if data is present (when configured in blocking mode
|
||||||
* only) </td>
|
* only) </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td> {@link java.net.StandardSocketOption#TCP_NODELAY TCP_NODELAY} </td>
|
* <td> {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} </td>
|
||||||
* <td> Disable the Nagle algorithm </td>
|
* <td> Disable the Nagle algorithm </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* </table>
|
* </table>
|
||||||
|
|
|
@ -609,11 +609,11 @@ public interface Path
|
||||||
* directory can be watched. The {@code events} parameter is the events to
|
* directory can be watched. The {@code events} parameter is the events to
|
||||||
* register and may contain the following events:
|
* register and may contain the following events:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link StandardWatchEventKind#ENTRY_CREATE ENTRY_CREATE} -
|
* <li>{@link StandardWatchEventKinds#ENTRY_CREATE ENTRY_CREATE} -
|
||||||
* entry created or moved into the directory</li>
|
* entry created or moved into the directory</li>
|
||||||
* <li>{@link StandardWatchEventKind#ENTRY_DELETE ENTRY_DELETE} -
|
* <li>{@link StandardWatchEventKinds#ENTRY_DELETE ENTRY_DELETE} -
|
||||||
* entry deleted or moved out of the directory</li>
|
* entry deleted or moved out of the directory</li>
|
||||||
* <li>{@link StandardWatchEventKind#ENTRY_MODIFY ENTRY_MODIFY} -
|
* <li>{@link StandardWatchEventKinds#ENTRY_MODIFY ENTRY_MODIFY} -
|
||||||
* entry in directory was modified</li>
|
* entry in directory was modified</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
|
@ -622,7 +622,7 @@ public interface Path
|
||||||
* that locates the directory entry that is created, deleted, or modified.
|
* that locates the directory entry that is created, deleted, or modified.
|
||||||
*
|
*
|
||||||
* <p> The set of events may include additional implementation specific
|
* <p> The set of events may include additional implementation specific
|
||||||
* event that are not defined by the enum {@link StandardWatchEventKind}
|
* event that are not defined by the enum {@link StandardWatchEventKinds}
|
||||||
*
|
*
|
||||||
* <p> The {@code modifiers} parameter specifies <em>modifiers</em> that
|
* <p> The {@code modifiers} parameter specifies <em>modifiers</em> that
|
||||||
* qualify how the directory is registered. This release does not define any
|
* qualify how the directory is registered. This release does not define any
|
||||||
|
|
|
@ -31,8 +31,8 @@ package java.nio.file;
|
||||||
* @since 1.7
|
* @since 1.7
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public final class StandardWatchEventKind {
|
public final class StandardWatchEventKinds {
|
||||||
private StandardWatchEventKind() { }
|
private StandardWatchEventKinds() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A special event to indicate that events may have been lost or
|
* A special event to indicate that events may have been lost or
|
||||||
|
@ -44,8 +44,8 @@ public final class StandardWatchEventKind {
|
||||||
*
|
*
|
||||||
* @see WatchService
|
* @see WatchService
|
||||||
*/
|
*/
|
||||||
public static final WatchEvent.Kind<Void> OVERFLOW =
|
public static final WatchEvent.Kind<Object> OVERFLOW =
|
||||||
new StdWatchEventKind<Void>("OVERFLOW", Void.class);
|
new StdWatchEventKind<Object>("OVERFLOW", Object.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Directory entry created.
|
* Directory entry created.
|
|
@ -50,7 +50,7 @@ public interface WatchEvent<T> {
|
||||||
* An event kind, for the purposes of identification.
|
* An event kind, for the purposes of identification.
|
||||||
*
|
*
|
||||||
* @since 1.7
|
* @since 1.7
|
||||||
* @see StandardWatchEventKind
|
* @see StandardWatchEventKinds
|
||||||
*/
|
*/
|
||||||
public static interface Kind<T> {
|
public static interface Kind<T> {
|
||||||
/**
|
/**
|
||||||
|
@ -98,9 +98,9 @@ public interface WatchEvent<T> {
|
||||||
/**
|
/**
|
||||||
* Returns the context for the event.
|
* Returns the context for the event.
|
||||||
*
|
*
|
||||||
* <p> In the case of {@link StandardWatchEventKind#ENTRY_CREATE ENTRY_CREATE},
|
* <p> In the case of {@link StandardWatchEventKinds#ENTRY_CREATE ENTRY_CREATE},
|
||||||
* {@link StandardWatchEventKind#ENTRY_DELETE ENTRY_DELETE}, and {@link
|
* {@link StandardWatchEventKinds#ENTRY_DELETE ENTRY_DELETE}, and {@link
|
||||||
* StandardWatchEventKind#ENTRY_MODIFY ENTRY_MODIFY} events the context is
|
* StandardWatchEventKinds#ENTRY_MODIFY ENTRY_MODIFY} events the context is
|
||||||
* a {@code Path} that is the {@link Path#relativize relative} path between
|
* a {@code Path} that is the {@link Path#relativize relative} path between
|
||||||
* the directory registered with the watch service, and the entry that is
|
* the directory registered with the watch service, and the entry that is
|
||||||
* created, deleted, or modified.
|
* created, deleted, or modified.
|
||||||
|
|
|
@ -68,7 +68,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
* of events that it may accumulate. Where an implementation <em>knowingly</em>
|
* of events that it may accumulate. Where an implementation <em>knowingly</em>
|
||||||
* discards events then it arranges for the key's {@link WatchKey#pollEvents
|
* discards events then it arranges for the key's {@link WatchKey#pollEvents
|
||||||
* pollEvents} method to return an element with an event type of {@link
|
* pollEvents} method to return an element with an event type of {@link
|
||||||
* StandardWatchEventKind#OVERFLOW OVERFLOW}. This event can be used by the
|
* StandardWatchEventKinds#OVERFLOW OVERFLOW}. This event can be used by the
|
||||||
* consumer as a trigger to re-examine the state of the object.
|
* consumer as a trigger to re-examine the state of the object.
|
||||||
*
|
*
|
||||||
* <p> When an event is reported to indicate that a file in a watched directory
|
* <p> When an event is reported to indicate that a file in a watched directory
|
||||||
|
@ -87,7 +87,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
* are detected, their timeliness, and whether their ordering is preserved are
|
* are detected, their timeliness, and whether their ordering is preserved are
|
||||||
* highly implementation specific. For example, when a file in a watched
|
* highly implementation specific. For example, when a file in a watched
|
||||||
* directory is modified then it may result in a single {@link
|
* directory is modified then it may result in a single {@link
|
||||||
* StandardWatchEventKind#ENTRY_MODIFY ENTRY_MODIFY} event in some
|
* StandardWatchEventKinds#ENTRY_MODIFY ENTRY_MODIFY} event in some
|
||||||
* implementations but several events in other implementations. Short-lived
|
* implementations but several events in other implementations. Short-lived
|
||||||
* files (meaning files that are deleted very quickly after they are created)
|
* files (meaning files that are deleted very quickly after they are created)
|
||||||
* may not be detected by primitive implementations that periodically poll the
|
* may not be detected by primitive implementations that periodically poll the
|
||||||
|
|
|
@ -53,7 +53,7 @@ public interface Watchable {
|
||||||
* those specified by the {@code events} and {@code modifiers} parameters.
|
* those specified by the {@code events} and {@code modifiers} parameters.
|
||||||
* Changing the event set does not cause pending events for the object to be
|
* Changing the event set does not cause pending events for the object to be
|
||||||
* discarded. Objects are automatically registered for the {@link
|
* discarded. Objects are automatically registered for the {@link
|
||||||
* StandardWatchEventKind#OVERFLOW OVERFLOW} event. This event is not
|
* StandardWatchEventKinds#OVERFLOW OVERFLOW} event. This event is not
|
||||||
* required to be present in the array of events.
|
* required to be present in the array of events.
|
||||||
*
|
*
|
||||||
* <p> Otherwise the file system object has not yet been registered with the
|
* <p> Otherwise the file system object has not yet been registered with the
|
||||||
|
|
|
@ -28,7 +28,7 @@ package sun.nio.ch;
|
||||||
import java.nio.channels.*;
|
import java.nio.channels.*;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
import java.net.SocketOption;
|
import java.net.SocketOption;
|
||||||
import java.net.StandardSocketOption;
|
import java.net.StandardSocketOptions;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -214,8 +214,8 @@ abstract class AsynchronousServerSocketChannelImpl
|
||||||
|
|
||||||
private static Set<SocketOption<?>> defaultOptions() {
|
private static Set<SocketOption<?>> defaultOptions() {
|
||||||
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(2);
|
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(2);
|
||||||
set.add(StandardSocketOption.SO_RCVBUF);
|
set.add(StandardSocketOptions.SO_RCVBUF);
|
||||||
set.add(StandardSocketOption.SO_REUSEADDR);
|
set.add(StandardSocketOptions.SO_REUSEADDR);
|
||||||
return Collections.unmodifiableSet(set);
|
return Collections.unmodifiableSet(set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ package sun.nio.ch;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.*;
|
import java.nio.channels.*;
|
||||||
import java.net.SocketOption;
|
import java.net.SocketOption;
|
||||||
import java.net.StandardSocketOption;
|
import java.net.StandardSocketOptions;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -483,11 +483,11 @@ abstract class AsynchronousSocketChannelImpl
|
||||||
|
|
||||||
private static Set<SocketOption<?>> defaultOptions() {
|
private static Set<SocketOption<?>> defaultOptions() {
|
||||||
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(5);
|
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(5);
|
||||||
set.add(StandardSocketOption.SO_SNDBUF);
|
set.add(StandardSocketOptions.SO_SNDBUF);
|
||||||
set.add(StandardSocketOption.SO_RCVBUF);
|
set.add(StandardSocketOptions.SO_RCVBUF);
|
||||||
set.add(StandardSocketOption.SO_KEEPALIVE);
|
set.add(StandardSocketOptions.SO_KEEPALIVE);
|
||||||
set.add(StandardSocketOption.SO_REUSEADDR);
|
set.add(StandardSocketOptions.SO_REUSEADDR);
|
||||||
set.add(StandardSocketOption.TCP_NODELAY);
|
set.add(StandardSocketOptions.TCP_NODELAY);
|
||||||
return Collections.unmodifiableSet(set);
|
return Collections.unmodifiableSet(set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,7 +188,7 @@ class DatagramChannelImpl
|
||||||
synchronized (stateLock) {
|
synchronized (stateLock) {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
|
|
||||||
if (name == StandardSocketOption.IP_TOS) {
|
if (name == StandardSocketOptions.IP_TOS) {
|
||||||
// IPv4 only; no-op for IPv6
|
// IPv4 only; no-op for IPv6
|
||||||
if (family == StandardProtocolFamily.INET) {
|
if (family == StandardProtocolFamily.INET) {
|
||||||
Net.setSocketOption(fd, family, name, value);
|
Net.setSocketOption(fd, family, name, value);
|
||||||
|
@ -196,15 +196,15 @@ class DatagramChannelImpl
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name == StandardSocketOption.IP_MULTICAST_TTL ||
|
if (name == StandardSocketOptions.IP_MULTICAST_TTL ||
|
||||||
name == StandardSocketOption.IP_MULTICAST_LOOP)
|
name == StandardSocketOptions.IP_MULTICAST_LOOP)
|
||||||
{
|
{
|
||||||
// options are protocol dependent
|
// options are protocol dependent
|
||||||
Net.setSocketOption(fd, family, name, value);
|
Net.setSocketOption(fd, family, name, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name == StandardSocketOption.IP_MULTICAST_IF) {
|
if (name == StandardSocketOptions.IP_MULTICAST_IF) {
|
||||||
if (value == null)
|
if (value == null)
|
||||||
throw new IllegalArgumentException("Cannot set IP_MULTICAST_IF to 'null'");
|
throw new IllegalArgumentException("Cannot set IP_MULTICAST_IF to 'null'");
|
||||||
NetworkInterface interf = (NetworkInterface)value;
|
NetworkInterface interf = (NetworkInterface)value;
|
||||||
|
@ -243,7 +243,7 @@ class DatagramChannelImpl
|
||||||
synchronized (stateLock) {
|
synchronized (stateLock) {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
|
|
||||||
if (name == StandardSocketOption.IP_TOS) {
|
if (name == StandardSocketOptions.IP_TOS) {
|
||||||
// IPv4 only; always return 0 on IPv6
|
// IPv4 only; always return 0 on IPv6
|
||||||
if (family == StandardProtocolFamily.INET) {
|
if (family == StandardProtocolFamily.INET) {
|
||||||
return (T) Net.getSocketOption(fd, family, name);
|
return (T) Net.getSocketOption(fd, family, name);
|
||||||
|
@ -252,13 +252,13 @@ class DatagramChannelImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name == StandardSocketOption.IP_MULTICAST_TTL ||
|
if (name == StandardSocketOptions.IP_MULTICAST_TTL ||
|
||||||
name == StandardSocketOption.IP_MULTICAST_LOOP)
|
name == StandardSocketOptions.IP_MULTICAST_LOOP)
|
||||||
{
|
{
|
||||||
return (T) Net.getSocketOption(fd, family, name);
|
return (T) Net.getSocketOption(fd, family, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name == StandardSocketOption.IP_MULTICAST_IF) {
|
if (name == StandardSocketOptions.IP_MULTICAST_IF) {
|
||||||
if (family == StandardProtocolFamily.INET) {
|
if (family == StandardProtocolFamily.INET) {
|
||||||
int address = Net.getInterface4(fd);
|
int address = Net.getInterface4(fd);
|
||||||
if (address == 0)
|
if (address == 0)
|
||||||
|
@ -291,14 +291,14 @@ class DatagramChannelImpl
|
||||||
|
|
||||||
private static Set<SocketOption<?>> defaultOptions() {
|
private static Set<SocketOption<?>> defaultOptions() {
|
||||||
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(8);
|
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(8);
|
||||||
set.add(StandardSocketOption.SO_SNDBUF);
|
set.add(StandardSocketOptions.SO_SNDBUF);
|
||||||
set.add(StandardSocketOption.SO_RCVBUF);
|
set.add(StandardSocketOptions.SO_RCVBUF);
|
||||||
set.add(StandardSocketOption.SO_REUSEADDR);
|
set.add(StandardSocketOptions.SO_REUSEADDR);
|
||||||
set.add(StandardSocketOption.SO_BROADCAST);
|
set.add(StandardSocketOptions.SO_BROADCAST);
|
||||||
set.add(StandardSocketOption.IP_TOS);
|
set.add(StandardSocketOptions.IP_TOS);
|
||||||
set.add(StandardSocketOption.IP_MULTICAST_IF);
|
set.add(StandardSocketOptions.IP_MULTICAST_IF);
|
||||||
set.add(StandardSocketOption.IP_MULTICAST_TTL);
|
set.add(StandardSocketOptions.IP_MULTICAST_TTL);
|
||||||
set.add(StandardSocketOption.IP_MULTICAST_LOOP);
|
set.add(StandardSocketOptions.IP_MULTICAST_LOOP);
|
||||||
return Collections.unmodifiableSet(set);
|
return Collections.unmodifiableSet(set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,46 +312,46 @@ public class DatagramSocketAdaptor
|
||||||
public void setSendBufferSize(int size) throws SocketException {
|
public void setSendBufferSize(int size) throws SocketException {
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
throw new IllegalArgumentException("Invalid send size");
|
throw new IllegalArgumentException("Invalid send size");
|
||||||
setIntOption(StandardSocketOption.SO_SNDBUF, size);
|
setIntOption(StandardSocketOptions.SO_SNDBUF, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSendBufferSize() throws SocketException {
|
public int getSendBufferSize() throws SocketException {
|
||||||
return getIntOption(StandardSocketOption.SO_SNDBUF);
|
return getIntOption(StandardSocketOptions.SO_SNDBUF);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReceiveBufferSize(int size) throws SocketException {
|
public void setReceiveBufferSize(int size) throws SocketException {
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
throw new IllegalArgumentException("Invalid receive size");
|
throw new IllegalArgumentException("Invalid receive size");
|
||||||
setIntOption(StandardSocketOption.SO_RCVBUF, size);
|
setIntOption(StandardSocketOptions.SO_RCVBUF, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getReceiveBufferSize() throws SocketException {
|
public int getReceiveBufferSize() throws SocketException {
|
||||||
return getIntOption(StandardSocketOption.SO_RCVBUF);
|
return getIntOption(StandardSocketOptions.SO_RCVBUF);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReuseAddress(boolean on) throws SocketException {
|
public void setReuseAddress(boolean on) throws SocketException {
|
||||||
setBooleanOption(StandardSocketOption.SO_REUSEADDR, on);
|
setBooleanOption(StandardSocketOptions.SO_REUSEADDR, on);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getReuseAddress() throws SocketException {
|
public boolean getReuseAddress() throws SocketException {
|
||||||
return getBooleanOption(StandardSocketOption.SO_REUSEADDR);
|
return getBooleanOption(StandardSocketOptions.SO_REUSEADDR);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBroadcast(boolean on) throws SocketException {
|
public void setBroadcast(boolean on) throws SocketException {
|
||||||
setBooleanOption(StandardSocketOption.SO_BROADCAST, on);
|
setBooleanOption(StandardSocketOptions.SO_BROADCAST, on);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getBroadcast() throws SocketException {
|
public boolean getBroadcast() throws SocketException {
|
||||||
return getBooleanOption(StandardSocketOption.SO_BROADCAST);
|
return getBooleanOption(StandardSocketOptions.SO_BROADCAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTrafficClass(int tc) throws SocketException {
|
public void setTrafficClass(int tc) throws SocketException {
|
||||||
setIntOption(StandardSocketOption.IP_TOS, tc);
|
setIntOption(StandardSocketOptions.IP_TOS, tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTrafficClass() throws SocketException {
|
public int getTrafficClass() throws SocketException {
|
||||||
return getIntOption(StandardSocketOption.IP_TOS);
|
return getIntOption(StandardSocketOptions.IP_TOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.net.SocketOption;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines socket options that are supported by the implementation
|
* Defines socket options that are supported by the implementation
|
||||||
* but not defined in StandardSocketOption.
|
* but not defined in StandardSocketOptions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ExtendedSocketOption {
|
class ExtendedSocketOption {
|
||||||
|
|
|
@ -237,26 +237,26 @@ class Net { // package-private
|
||||||
throw new AssertionError("Should not reach here");
|
throw new AssertionError("Should not reach here");
|
||||||
|
|
||||||
// special handling
|
// special handling
|
||||||
if (name == StandardSocketOption.SO_RCVBUF ||
|
if (name == StandardSocketOptions.SO_RCVBUF ||
|
||||||
name == StandardSocketOption.SO_SNDBUF)
|
name == StandardSocketOptions.SO_SNDBUF)
|
||||||
{
|
{
|
||||||
int i = ((Integer)value).intValue();
|
int i = ((Integer)value).intValue();
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
throw new IllegalArgumentException("Invalid send/receive buffer size");
|
throw new IllegalArgumentException("Invalid send/receive buffer size");
|
||||||
}
|
}
|
||||||
if (name == StandardSocketOption.SO_LINGER) {
|
if (name == StandardSocketOptions.SO_LINGER) {
|
||||||
int i = ((Integer)value).intValue();
|
int i = ((Integer)value).intValue();
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
value = Integer.valueOf(-1);
|
value = Integer.valueOf(-1);
|
||||||
if (i > 65535)
|
if (i > 65535)
|
||||||
value = Integer.valueOf(65535);
|
value = Integer.valueOf(65535);
|
||||||
}
|
}
|
||||||
if (name == StandardSocketOption.IP_TOS) {
|
if (name == StandardSocketOptions.IP_TOS) {
|
||||||
int i = ((Integer)value).intValue();
|
int i = ((Integer)value).intValue();
|
||||||
if (i < 0 || i > 255)
|
if (i < 0 || i > 255)
|
||||||
throw new IllegalArgumentException("Invalid IP_TOS value");
|
throw new IllegalArgumentException("Invalid IP_TOS value");
|
||||||
}
|
}
|
||||||
if (name == StandardSocketOption.IP_MULTICAST_TTL) {
|
if (name == StandardSocketOptions.IP_MULTICAST_TTL) {
|
||||||
int i = ((Integer)value).intValue();
|
int i = ((Integer)value).intValue();
|
||||||
if (i < 0 || i > 255)
|
if (i < 0 || i > 255)
|
||||||
throw new IllegalArgumentException("Invalid TTL/hop value");
|
throw new IllegalArgumentException("Invalid TTL/hop value");
|
||||||
|
|
|
@ -169,7 +169,7 @@ public class ServerSocketAdaptor // package-private
|
||||||
|
|
||||||
public void setReuseAddress(boolean on) throws SocketException {
|
public void setReuseAddress(boolean on) throws SocketException {
|
||||||
try {
|
try {
|
||||||
ssc.setOption(StandardSocketOption.SO_REUSEADDR, on);
|
ssc.setOption(StandardSocketOptions.SO_REUSEADDR, on);
|
||||||
} catch (IOException x) {
|
} catch (IOException x) {
|
||||||
Net.translateToSocketException(x);
|
Net.translateToSocketException(x);
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ public class ServerSocketAdaptor // package-private
|
||||||
|
|
||||||
public boolean getReuseAddress() throws SocketException {
|
public boolean getReuseAddress() throws SocketException {
|
||||||
try {
|
try {
|
||||||
return ssc.getOption(StandardSocketOption.SO_REUSEADDR).booleanValue();
|
return ssc.getOption(StandardSocketOptions.SO_REUSEADDR).booleanValue();
|
||||||
} catch (IOException x) {
|
} catch (IOException x) {
|
||||||
Net.translateToSocketException(x);
|
Net.translateToSocketException(x);
|
||||||
return false; // Never happens
|
return false; // Never happens
|
||||||
|
@ -197,7 +197,7 @@ public class ServerSocketAdaptor // package-private
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
throw new IllegalArgumentException("size cannot be 0 or negative");
|
throw new IllegalArgumentException("size cannot be 0 or negative");
|
||||||
try {
|
try {
|
||||||
ssc.setOption(StandardSocketOption.SO_RCVBUF, size);
|
ssc.setOption(StandardSocketOptions.SO_RCVBUF, size);
|
||||||
} catch (IOException x) {
|
} catch (IOException x) {
|
||||||
Net.translateToSocketException(x);
|
Net.translateToSocketException(x);
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ public class ServerSocketAdaptor // package-private
|
||||||
|
|
||||||
public int getReceiveBufferSize() throws SocketException {
|
public int getReceiveBufferSize() throws SocketException {
|
||||||
try {
|
try {
|
||||||
return ssc.getOption(StandardSocketOption.SO_RCVBUF).intValue();
|
return ssc.getOption(StandardSocketOptions.SO_RCVBUF).intValue();
|
||||||
} catch (IOException x) {
|
} catch (IOException x) {
|
||||||
Net.translateToSocketException(x);
|
Net.translateToSocketException(x);
|
||||||
return -1; // Never happens
|
return -1; // Never happens
|
||||||
|
|
|
@ -160,8 +160,8 @@ class ServerSocketChannelImpl
|
||||||
|
|
||||||
private static Set<SocketOption<?>> defaultOptions() {
|
private static Set<SocketOption<?>> defaultOptions() {
|
||||||
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(2);
|
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(2);
|
||||||
set.add(StandardSocketOption.SO_RCVBUF);
|
set.add(StandardSocketOptions.SO_RCVBUF);
|
||||||
set.add(StandardSocketOption.SO_REUSEADDR);
|
set.add(StandardSocketOptions.SO_REUSEADDR);
|
||||||
return Collections.unmodifiableSet(set);
|
return Collections.unmodifiableSet(set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,21 +318,21 @@ public class SocketAdaptor
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTcpNoDelay(boolean on) throws SocketException {
|
public void setTcpNoDelay(boolean on) throws SocketException {
|
||||||
setBooleanOption(StandardSocketOption.TCP_NODELAY, on);
|
setBooleanOption(StandardSocketOptions.TCP_NODELAY, on);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getTcpNoDelay() throws SocketException {
|
public boolean getTcpNoDelay() throws SocketException {
|
||||||
return getBooleanOption(StandardSocketOption.TCP_NODELAY);
|
return getBooleanOption(StandardSocketOptions.TCP_NODELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSoLinger(boolean on, int linger) throws SocketException {
|
public void setSoLinger(boolean on, int linger) throws SocketException {
|
||||||
if (!on)
|
if (!on)
|
||||||
linger = -1;
|
linger = -1;
|
||||||
setIntOption(StandardSocketOption.SO_LINGER, linger);
|
setIntOption(StandardSocketOptions.SO_LINGER, linger);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSoLinger() throws SocketException {
|
public int getSoLinger() throws SocketException {
|
||||||
return getIntOption(StandardSocketOption.SO_LINGER);
|
return getIntOption(StandardSocketOptions.SO_LINGER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendUrgentData(int data) throws IOException {
|
public void sendUrgentData(int data) throws IOException {
|
||||||
|
@ -366,46 +366,46 @@ public class SocketAdaptor
|
||||||
// size 0 valid for SocketChannel, invalid for Socket
|
// size 0 valid for SocketChannel, invalid for Socket
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
throw new IllegalArgumentException("Invalid send size");
|
throw new IllegalArgumentException("Invalid send size");
|
||||||
setIntOption(StandardSocketOption.SO_SNDBUF, size);
|
setIntOption(StandardSocketOptions.SO_SNDBUF, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSendBufferSize() throws SocketException {
|
public int getSendBufferSize() throws SocketException {
|
||||||
return getIntOption(StandardSocketOption.SO_SNDBUF);
|
return getIntOption(StandardSocketOptions.SO_SNDBUF);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReceiveBufferSize(int size) throws SocketException {
|
public void setReceiveBufferSize(int size) throws SocketException {
|
||||||
// size 0 valid for SocketChannel, invalid for Socket
|
// size 0 valid for SocketChannel, invalid for Socket
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
throw new IllegalArgumentException("Invalid receive size");
|
throw new IllegalArgumentException("Invalid receive size");
|
||||||
setIntOption(StandardSocketOption.SO_RCVBUF, size);
|
setIntOption(StandardSocketOptions.SO_RCVBUF, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getReceiveBufferSize() throws SocketException {
|
public int getReceiveBufferSize() throws SocketException {
|
||||||
return getIntOption(StandardSocketOption.SO_RCVBUF);
|
return getIntOption(StandardSocketOptions.SO_RCVBUF);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKeepAlive(boolean on) throws SocketException {
|
public void setKeepAlive(boolean on) throws SocketException {
|
||||||
setBooleanOption(StandardSocketOption.SO_KEEPALIVE, on);
|
setBooleanOption(StandardSocketOptions.SO_KEEPALIVE, on);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getKeepAlive() throws SocketException {
|
public boolean getKeepAlive() throws SocketException {
|
||||||
return getBooleanOption(StandardSocketOption.SO_KEEPALIVE);
|
return getBooleanOption(StandardSocketOptions.SO_KEEPALIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTrafficClass(int tc) throws SocketException {
|
public void setTrafficClass(int tc) throws SocketException {
|
||||||
setIntOption(StandardSocketOption.IP_TOS, tc);
|
setIntOption(StandardSocketOptions.IP_TOS, tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTrafficClass() throws SocketException {
|
public int getTrafficClass() throws SocketException {
|
||||||
return getIntOption(StandardSocketOption.IP_TOS);
|
return getIntOption(StandardSocketOptions.IP_TOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReuseAddress(boolean on) throws SocketException {
|
public void setReuseAddress(boolean on) throws SocketException {
|
||||||
setBooleanOption(StandardSocketOption.SO_REUSEADDR, on);
|
setBooleanOption(StandardSocketOptions.SO_REUSEADDR, on);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getReuseAddress() throws SocketException {
|
public boolean getReuseAddress() throws SocketException {
|
||||||
return getBooleanOption(StandardSocketOption.SO_REUSEADDR);
|
return getBooleanOption(StandardSocketOptions.SO_REUSEADDR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
|
|
|
@ -170,7 +170,7 @@ class SocketChannelImpl
|
||||||
throw new ClosedChannelException();
|
throw new ClosedChannelException();
|
||||||
|
|
||||||
// special handling for IP_TOS: no-op when IPv6
|
// special handling for IP_TOS: no-op when IPv6
|
||||||
if (name == StandardSocketOption.IP_TOS) {
|
if (name == StandardSocketOptions.IP_TOS) {
|
||||||
if (!Net.isIPv6Available())
|
if (!Net.isIPv6Available())
|
||||||
Net.setSocketOption(fd, StandardProtocolFamily.INET, name, value);
|
Net.setSocketOption(fd, StandardProtocolFamily.INET, name, value);
|
||||||
return this;
|
return this;
|
||||||
|
@ -197,7 +197,7 @@ class SocketChannelImpl
|
||||||
throw new ClosedChannelException();
|
throw new ClosedChannelException();
|
||||||
|
|
||||||
// special handling for IP_TOS: always return 0 when IPv6
|
// special handling for IP_TOS: always return 0 when IPv6
|
||||||
if (name == StandardSocketOption.IP_TOS) {
|
if (name == StandardSocketOptions.IP_TOS) {
|
||||||
return (Net.isIPv6Available()) ? (T) Integer.valueOf(0) :
|
return (Net.isIPv6Available()) ? (T) Integer.valueOf(0) :
|
||||||
(T) Net.getSocketOption(fd, StandardProtocolFamily.INET, name);
|
(T) Net.getSocketOption(fd, StandardProtocolFamily.INET, name);
|
||||||
}
|
}
|
||||||
|
@ -212,14 +212,14 @@ class SocketChannelImpl
|
||||||
|
|
||||||
private static Set<SocketOption<?>> defaultOptions() {
|
private static Set<SocketOption<?>> defaultOptions() {
|
||||||
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(8);
|
HashSet<SocketOption<?>> set = new HashSet<SocketOption<?>>(8);
|
||||||
set.add(StandardSocketOption.SO_SNDBUF);
|
set.add(StandardSocketOptions.SO_SNDBUF);
|
||||||
set.add(StandardSocketOption.SO_RCVBUF);
|
set.add(StandardSocketOptions.SO_RCVBUF);
|
||||||
set.add(StandardSocketOption.SO_KEEPALIVE);
|
set.add(StandardSocketOptions.SO_KEEPALIVE);
|
||||||
set.add(StandardSocketOption.SO_REUSEADDR);
|
set.add(StandardSocketOptions.SO_REUSEADDR);
|
||||||
set.add(StandardSocketOption.SO_LINGER);
|
set.add(StandardSocketOptions.SO_LINGER);
|
||||||
set.add(StandardSocketOption.TCP_NODELAY);
|
set.add(StandardSocketOptions.TCP_NODELAY);
|
||||||
// additional options required by socket adaptor
|
// additional options required by socket adaptor
|
||||||
set.add(StandardSocketOption.IP_TOS);
|
set.add(StandardSocketOptions.IP_TOS);
|
||||||
set.add(ExtendedSocketOption.SO_OOBINLINE);
|
set.add(ExtendedSocketOption.SO_OOBINLINE);
|
||||||
return Collections.unmodifiableSet(set);
|
return Collections.unmodifiableSet(set);
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,16 +105,16 @@ abstract class AbstractPoller implements Runnable {
|
||||||
Set<WatchEvent.Kind<?>> eventSet = new HashSet<>(events.length);
|
Set<WatchEvent.Kind<?>> eventSet = new HashSet<>(events.length);
|
||||||
for (WatchEvent.Kind<?> event: events) {
|
for (WatchEvent.Kind<?> event: events) {
|
||||||
// standard events
|
// standard events
|
||||||
if (event == StandardWatchEventKind.ENTRY_CREATE ||
|
if (event == StandardWatchEventKinds.ENTRY_CREATE ||
|
||||||
event == StandardWatchEventKind.ENTRY_MODIFY ||
|
event == StandardWatchEventKinds.ENTRY_MODIFY ||
|
||||||
event == StandardWatchEventKind.ENTRY_DELETE)
|
event == StandardWatchEventKinds.ENTRY_DELETE)
|
||||||
{
|
{
|
||||||
eventSet.add(event);
|
eventSet.add(event);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OVERFLOW is ignored
|
// OVERFLOW is ignored
|
||||||
if (event == StandardWatchEventKind.OVERFLOW) {
|
if (event == StandardWatchEventKinds.OVERFLOW) {
|
||||||
if (events.length == 1)
|
if (events.length == 1)
|
||||||
throw new IllegalArgumentException("No events to register");
|
throw new IllegalArgumentException("No events to register");
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -42,8 +42,8 @@ abstract class AbstractWatchKey implements WatchKey {
|
||||||
/**
|
/**
|
||||||
* Special event to signal overflow
|
* Special event to signal overflow
|
||||||
*/
|
*/
|
||||||
static final Event<Void> OVERFLOW_EVENT =
|
static final Event<Object> OVERFLOW_EVENT =
|
||||||
new Event<Void>(StandardWatchEventKind.OVERFLOW, null);
|
new Event<Object>(StandardWatchEventKinds.OVERFLOW, null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Possible key states
|
* Possible key states
|
||||||
|
@ -103,14 +103,14 @@ abstract class AbstractWatchKey implements WatchKey {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
final void signalEvent(WatchEvent.Kind<?> kind, Object context) {
|
final void signalEvent(WatchEvent.Kind<?> kind, Object context) {
|
||||||
boolean isModify = (kind == StandardWatchEventKind.ENTRY_MODIFY);
|
boolean isModify = (kind == StandardWatchEventKinds.ENTRY_MODIFY);
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
int size = events.size();
|
int size = events.size();
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
// if the previous event is an OVERFLOW event or this is a
|
// if the previous event is an OVERFLOW event or this is a
|
||||||
// repeated event then we simply increment the counter
|
// repeated event then we simply increment the counter
|
||||||
WatchEvent<?> prev = events.get(size-1);
|
WatchEvent<?> prev = events.get(size-1);
|
||||||
if ((prev.kind() == StandardWatchEventKind.OVERFLOW) ||
|
if ((prev.kind() == StandardWatchEventKinds.OVERFLOW) ||
|
||||||
((kind == prev.kind() &&
|
((kind == prev.kind() &&
|
||||||
Objects.equals(context, prev.context()))))
|
Objects.equals(context, prev.context()))))
|
||||||
{
|
{
|
||||||
|
@ -124,7 +124,7 @@ abstract class AbstractWatchKey implements WatchKey {
|
||||||
if (isModify) {
|
if (isModify) {
|
||||||
WatchEvent<?> ev = lastModifyEvents.get(context);
|
WatchEvent<?> ev = lastModifyEvents.get(context);
|
||||||
if (ev != null) {
|
if (ev != null) {
|
||||||
assert ev.kind() == StandardWatchEventKind.ENTRY_MODIFY;
|
assert ev.kind() == StandardWatchEventKinds.ENTRY_MODIFY;
|
||||||
((Event<?>)ev).increment();
|
((Event<?>)ev).increment();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ abstract class AbstractWatchKey implements WatchKey {
|
||||||
// if the list has reached the limit then drop pending events
|
// if the list has reached the limit then drop pending events
|
||||||
// and queue an OVERFLOW event
|
// and queue an OVERFLOW event
|
||||||
if (size >= MAX_EVENT_LIST_SIZE) {
|
if (size >= MAX_EVENT_LIST_SIZE) {
|
||||||
kind = StandardWatchEventKind.OVERFLOW;
|
kind = StandardWatchEventKinds.OVERFLOW;
|
||||||
isModify = false;
|
isModify = false;
|
||||||
context = null;
|
context = null;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ abstract class AbstractWatchKey implements WatchKey {
|
||||||
new Event<Object>((WatchEvent.Kind<Object>)kind, context);
|
new Event<Object>((WatchEvent.Kind<Object>)kind, context);
|
||||||
if (isModify) {
|
if (isModify) {
|
||||||
lastModifyEvents.put(context, ev);
|
lastModifyEvents.put(context, ev);
|
||||||
} else if (kind == StandardWatchEventKind.OVERFLOW) {
|
} else if (kind == StandardWatchEventKinds.OVERFLOW) {
|
||||||
// drop all pending events
|
// drop all pending events
|
||||||
events.clear();
|
events.clear();
|
||||||
lastModifyEvents.clear();
|
lastModifyEvents.clear();
|
||||||
|
|
|
@ -80,16 +80,16 @@ class PollingWatchService
|
||||||
new HashSet<WatchEvent.Kind<?>>(events.length);
|
new HashSet<WatchEvent.Kind<?>>(events.length);
|
||||||
for (WatchEvent.Kind<?> event: events) {
|
for (WatchEvent.Kind<?> event: events) {
|
||||||
// standard events
|
// standard events
|
||||||
if (event == StandardWatchEventKind.ENTRY_CREATE ||
|
if (event == StandardWatchEventKinds.ENTRY_CREATE ||
|
||||||
event == StandardWatchEventKind.ENTRY_MODIFY ||
|
event == StandardWatchEventKinds.ENTRY_MODIFY ||
|
||||||
event == StandardWatchEventKind.ENTRY_DELETE)
|
event == StandardWatchEventKinds.ENTRY_DELETE)
|
||||||
{
|
{
|
||||||
eventSet.add(event);
|
eventSet.add(event);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OVERFLOW is ignored
|
// OVERFLOW is ignored
|
||||||
if (event == StandardWatchEventKind.OVERFLOW) {
|
if (event == StandardWatchEventKinds.OVERFLOW) {
|
||||||
if (events.length == 1)
|
if (events.length == 1)
|
||||||
throw new IllegalArgumentException("No events to register");
|
throw new IllegalArgumentException("No events to register");
|
||||||
continue;
|
continue;
|
||||||
|
@ -355,16 +355,16 @@ class PollingWatchService
|
||||||
new CacheEntry(lastModified, tickCount));
|
new CacheEntry(lastModified, tickCount));
|
||||||
|
|
||||||
// queue ENTRY_CREATE if event enabled
|
// queue ENTRY_CREATE if event enabled
|
||||||
if (events.contains(StandardWatchEventKind.ENTRY_CREATE)) {
|
if (events.contains(StandardWatchEventKinds.ENTRY_CREATE)) {
|
||||||
signalEvent(StandardWatchEventKind.ENTRY_CREATE, entry.getFileName());
|
signalEvent(StandardWatchEventKinds.ENTRY_CREATE, entry.getFileName());
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
// if ENTRY_CREATE is not enabled and ENTRY_MODIFY is
|
// if ENTRY_CREATE is not enabled and ENTRY_MODIFY is
|
||||||
// enabled then queue event to avoid missing out on
|
// enabled then queue event to avoid missing out on
|
||||||
// modifications to the file immediately after it is
|
// modifications to the file immediately after it is
|
||||||
// created.
|
// created.
|
||||||
if (events.contains(StandardWatchEventKind.ENTRY_MODIFY)) {
|
if (events.contains(StandardWatchEventKinds.ENTRY_MODIFY)) {
|
||||||
signalEvent(StandardWatchEventKind.ENTRY_MODIFY, entry.getFileName());
|
signalEvent(StandardWatchEventKinds.ENTRY_MODIFY, entry.getFileName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -372,8 +372,8 @@ class PollingWatchService
|
||||||
|
|
||||||
// check if file has changed
|
// check if file has changed
|
||||||
if (e.lastModified != lastModified) {
|
if (e.lastModified != lastModified) {
|
||||||
if (events.contains(StandardWatchEventKind.ENTRY_MODIFY)) {
|
if (events.contains(StandardWatchEventKinds.ENTRY_MODIFY)) {
|
||||||
signalEvent(StandardWatchEventKind.ENTRY_MODIFY,
|
signalEvent(StandardWatchEventKinds.ENTRY_MODIFY,
|
||||||
entry.getFileName());
|
entry.getFileName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,8 +403,8 @@ class PollingWatchService
|
||||||
Path name = mapEntry.getKey();
|
Path name = mapEntry.getKey();
|
||||||
// remove from map and queue delete event (if enabled)
|
// remove from map and queue delete event (if enabled)
|
||||||
i.remove();
|
i.remove();
|
||||||
if (events.contains(StandardWatchEventKind.ENTRY_DELETE)) {
|
if (events.contains(StandardWatchEventKinds.ENTRY_DELETE)) {
|
||||||
signalEvent(StandardWatchEventKind.ENTRY_DELETE, name);
|
signalEvent(StandardWatchEventKinds.ENTRY_DELETE, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ int main(int argc, const char* argv[]) {
|
||||||
out("// AUTOMATICALLY GENERATED FILE - DO NOT EDIT ");
|
out("// AUTOMATICALLY GENERATED FILE - DO NOT EDIT ");
|
||||||
out("package sun.nio.ch; ");
|
out("package sun.nio.ch; ");
|
||||||
out("import java.net.SocketOption; ");
|
out("import java.net.SocketOption; ");
|
||||||
out("import java.net.StandardSocketOption; ");
|
out("import java.net.StandardSocketOptions; ");
|
||||||
out("import java.net.ProtocolFamily; ");
|
out("import java.net.ProtocolFamily; ");
|
||||||
out("import java.net.StandardProtocolFamily; ");
|
out("import java.net.StandardProtocolFamily; ");
|
||||||
out("import java.util.Map; ");
|
out("import java.util.Map; ");
|
||||||
|
@ -95,23 +95,23 @@ int main(int argc, const char* argv[]) {
|
||||||
out(" Map<RegistryKey,OptionKey> map = ");
|
out(" Map<RegistryKey,OptionKey> map = ");
|
||||||
out(" new HashMap<RegistryKey,OptionKey>(); ");
|
out(" new HashMap<RegistryKey,OptionKey>(); ");
|
||||||
|
|
||||||
emit_unspec("StandardSocketOption.SO_BROADCAST", SOL_SOCKET, SO_BROADCAST);
|
emit_unspec("StandardSocketOptions.SO_BROADCAST", SOL_SOCKET, SO_BROADCAST);
|
||||||
emit_unspec("StandardSocketOption.SO_KEEPALIVE", SOL_SOCKET, SO_KEEPALIVE);
|
emit_unspec("StandardSocketOptions.SO_KEEPALIVE", SOL_SOCKET, SO_KEEPALIVE);
|
||||||
emit_unspec("StandardSocketOption.SO_LINGER", SOL_SOCKET, SO_LINGER);
|
emit_unspec("StandardSocketOptions.SO_LINGER", SOL_SOCKET, SO_LINGER);
|
||||||
emit_unspec("StandardSocketOption.SO_SNDBUF", SOL_SOCKET, SO_SNDBUF);
|
emit_unspec("StandardSocketOptions.SO_SNDBUF", SOL_SOCKET, SO_SNDBUF);
|
||||||
emit_unspec("StandardSocketOption.SO_RCVBUF", SOL_SOCKET, SO_RCVBUF);
|
emit_unspec("StandardSocketOptions.SO_RCVBUF", SOL_SOCKET, SO_RCVBUF);
|
||||||
emit_unspec("StandardSocketOption.SO_REUSEADDR", SOL_SOCKET, SO_REUSEADDR);
|
emit_unspec("StandardSocketOptions.SO_REUSEADDR", SOL_SOCKET, SO_REUSEADDR);
|
||||||
emit_unspec("StandardSocketOption.TCP_NODELAY", IPPROTO_TCP, TCP_NODELAY);
|
emit_unspec("StandardSocketOptions.TCP_NODELAY", IPPROTO_TCP, TCP_NODELAY);
|
||||||
|
|
||||||
emit_inet("StandardSocketOption.IP_TOS", IPPROTO_IP, IP_TOS);
|
emit_inet("StandardSocketOptions.IP_TOS", IPPROTO_IP, IP_TOS);
|
||||||
emit_inet("StandardSocketOption.IP_MULTICAST_IF", IPPROTO_IP, IP_MULTICAST_IF);
|
emit_inet("StandardSocketOptions.IP_MULTICAST_IF", IPPROTO_IP, IP_MULTICAST_IF);
|
||||||
emit_inet("StandardSocketOption.IP_MULTICAST_TTL", IPPROTO_IP, IP_MULTICAST_TTL);
|
emit_inet("StandardSocketOptions.IP_MULTICAST_TTL", IPPROTO_IP, IP_MULTICAST_TTL);
|
||||||
emit_inet("StandardSocketOption.IP_MULTICAST_LOOP", IPPROTO_IP, IP_MULTICAST_LOOP);
|
emit_inet("StandardSocketOptions.IP_MULTICAST_LOOP", IPPROTO_IP, IP_MULTICAST_LOOP);
|
||||||
|
|
||||||
#ifdef AF_INET6
|
#ifdef AF_INET6
|
||||||
emit_inet6("StandardSocketOption.IP_MULTICAST_IF", IPPROTO_IPV6, IPV6_MULTICAST_IF);
|
emit_inet6("StandardSocketOptions.IP_MULTICAST_IF", IPPROTO_IPV6, IPV6_MULTICAST_IF);
|
||||||
emit_inet6("StandardSocketOption.IP_MULTICAST_TTL", IPPROTO_IPV6, IPV6_MULTICAST_HOPS);
|
emit_inet6("StandardSocketOptions.IP_MULTICAST_TTL", IPPROTO_IPV6, IPV6_MULTICAST_HOPS);
|
||||||
emit_inet6("StandardSocketOption.IP_MULTICAST_LOOP", IPPROTO_IPV6, IPV6_MULTICAST_LOOP);
|
emit_inet6("StandardSocketOptions.IP_MULTICAST_LOOP", IPPROTO_IPV6, IPV6_MULTICAST_LOOP);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
emit_unspec("ExtendedSocketOption.SO_OOBINLINE", SOL_SOCKET, SO_OOBINLINE);
|
emit_unspec("ExtendedSocketOption.SO_OOBINLINE", SOL_SOCKET, SO_OOBINLINE);
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
import java.net.StandardSocketOption;
|
import java.net.StandardSocketOptions;
|
||||||
import java.nio.channels.*;
|
import java.nio.channels.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
@ -105,7 +105,7 @@ public class ChatServer implements Runnable {
|
||||||
*/
|
*/
|
||||||
private AsynchronousServerSocketChannel createListener(AsynchronousChannelGroup channelGroup) throws IOException {
|
private AsynchronousServerSocketChannel createListener(AsynchronousChannelGroup channelGroup) throws IOException {
|
||||||
final AsynchronousServerSocketChannel listener = openChannel(channelGroup);
|
final AsynchronousServerSocketChannel listener = openChannel(channelGroup);
|
||||||
listener.setOption(StandardSocketOption.SO_REUSEADDR, true);
|
listener.setOption(StandardSocketOptions.SO_REUSEADDR, true);
|
||||||
listener.bind(new InetSocketAddress(port));
|
listener.bind(new InetSocketAddress(port));
|
||||||
return listener;
|
return listener;
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ public class ChatServer implements Runnable {
|
||||||
private void handleNewConnection(AsynchronousSocketChannel channel) {
|
private void handleNewConnection(AsynchronousSocketChannel channel) {
|
||||||
Client client = new Client(channel, new ClientReader(this, new NameReader(this)));
|
Client client = new Client(channel, new ClientReader(this, new NameReader(this)));
|
||||||
try {
|
try {
|
||||||
channel.setOption(StandardSocketOption.TCP_NODELAY, true);
|
channel.setOption(StandardSocketOptions.TCP_NODELAY, true);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import static java.nio.file.StandardWatchEventKind.*;
|
import static java.nio.file.StandardWatchEventKinds.*;
|
||||||
import static java.nio.file.LinkOption.*;
|
import static java.nio.file.LinkOption.*;
|
||||||
import java.nio.file.attribute.*;
|
import java.nio.file.attribute.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class Reader {
|
||||||
family = StandardProtocolFamily.INET6;
|
family = StandardProtocolFamily.INET6;
|
||||||
}
|
}
|
||||||
DatagramChannel dc = DatagramChannel.open(family)
|
DatagramChannel dc = DatagramChannel.open(family)
|
||||||
.setOption(StandardSocketOption.SO_REUSEADDR, true)
|
.setOption(StandardSocketOptions.SO_REUSEADDR, true)
|
||||||
.bind(new InetSocketAddress(target.port()));
|
.bind(new InetSocketAddress(target.port()));
|
||||||
|
|
||||||
if (includeList.isEmpty()) {
|
if (includeList.isEmpty()) {
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class Sender {
|
||||||
family = StandardProtocolFamily.INET6;
|
family = StandardProtocolFamily.INET6;
|
||||||
DatagramChannel dc = DatagramChannel.open(family).bind(new InetSocketAddress(0));
|
DatagramChannel dc = DatagramChannel.open(family).bind(new InetSocketAddress(0));
|
||||||
if (target.interf() != null) {
|
if (target.interf() != null) {
|
||||||
dc.setOption(StandardSocketOption.IP_MULTICAST_IF, target.interf());
|
dc.setOption(StandardSocketOptions.IP_MULTICAST_IF, target.interf());
|
||||||
}
|
}
|
||||||
|
|
||||||
// send multicast packet
|
// send multicast packet
|
||||||
|
|
|
@ -55,7 +55,7 @@ import com.sun.nio.sctp.SctpChannel;
|
||||||
import com.sun.nio.sctp.SctpSocketOption;
|
import com.sun.nio.sctp.SctpSocketOption;
|
||||||
import sun.nio.ch.PollArrayWrapper;
|
import sun.nio.ch.PollArrayWrapper;
|
||||||
import sun.nio.ch.SelChImpl;
|
import sun.nio.ch.SelChImpl;
|
||||||
import static com.sun.nio.sctp.SctpStandardSocketOption.*;
|
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
|
||||||
import static sun.nio.ch.SctpResultContainer.SEND_FAILED;
|
import static sun.nio.ch.SctpResultContainer.SEND_FAILED;
|
||||||
import static sun.nio.ch.SctpResultContainer.ASSOCIATION_CHANGED;
|
import static sun.nio.ch.SctpResultContainer.ASSOCIATION_CHANGED;
|
||||||
import static sun.nio.ch.SctpResultContainer.PEER_ADDRESS_CHANGED;
|
import static sun.nio.ch.SctpResultContainer.PEER_ADDRESS_CHANGED;
|
||||||
|
|
|
@ -53,7 +53,7 @@ import com.sun.nio.sctp.MessageInfo;
|
||||||
import com.sun.nio.sctp.SctpChannel;
|
import com.sun.nio.sctp.SctpChannel;
|
||||||
import com.sun.nio.sctp.SctpMultiChannel;
|
import com.sun.nio.sctp.SctpMultiChannel;
|
||||||
import com.sun.nio.sctp.SctpSocketOption;
|
import com.sun.nio.sctp.SctpSocketOption;
|
||||||
import static com.sun.nio.sctp.SctpStandardSocketOption.*;
|
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
|
||||||
import static sun.nio.ch.SctpResultContainer.*;
|
import static sun.nio.ch.SctpResultContainer.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.util.HashSet;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import sun.security.action.GetPropertyAction;
|
import sun.security.action.GetPropertyAction;
|
||||||
import com.sun.nio.sctp.SctpSocketOption;
|
import com.sun.nio.sctp.SctpSocketOption;
|
||||||
import static com.sun.nio.sctp.SctpStandardSocketOption.*;
|
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
|
||||||
|
|
||||||
public class SctpNet {
|
public class SctpNet {
|
||||||
static final String osName = AccessController.doPrivileged(
|
static final String osName = AccessController.doPrivileged(
|
||||||
|
|
|
@ -40,7 +40,7 @@ import com.sun.nio.sctp.IllegalUnbindException;
|
||||||
import com.sun.nio.sctp.SctpChannel;
|
import com.sun.nio.sctp.SctpChannel;
|
||||||
import com.sun.nio.sctp.SctpServerChannel;
|
import com.sun.nio.sctp.SctpServerChannel;
|
||||||
import com.sun.nio.sctp.SctpSocketOption;
|
import com.sun.nio.sctp.SctpSocketOption;
|
||||||
import com.sun.nio.sctp.SctpStandardSocketOption;
|
import com.sun.nio.sctp.SctpStandardSocketOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implementation of SctpServerChannel
|
* An implementation of SctpServerChannel
|
||||||
|
@ -386,7 +386,7 @@ public class SctpServerChannelImpl extends SctpServerChannel
|
||||||
|
|
||||||
private static Set<SctpSocketOption<?>> defaultOptions() {
|
private static Set<SctpSocketOption<?>> defaultOptions() {
|
||||||
HashSet<SctpSocketOption<?>> set = new HashSet<SctpSocketOption<?>>(1);
|
HashSet<SctpSocketOption<?>> set = new HashSet<SctpSocketOption<?>>(1);
|
||||||
set.add(SctpStandardSocketOption.SCTP_INIT_MAXSTREAMS);
|
set.add(SctpStandardSocketOptions.SCTP_INIT_MAXSTREAMS);
|
||||||
return Collections.unmodifiableSet(set);
|
return Collections.unmodifiableSet(set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,15 +210,15 @@ class LinuxWatchService
|
||||||
|
|
||||||
int mask = 0;
|
int mask = 0;
|
||||||
for (WatchEvent.Kind<?> event: events) {
|
for (WatchEvent.Kind<?> event: events) {
|
||||||
if (event == StandardWatchEventKind.ENTRY_CREATE) {
|
if (event == StandardWatchEventKinds.ENTRY_CREATE) {
|
||||||
mask |= IN_CREATE | IN_MOVED_TO;
|
mask |= IN_CREATE | IN_MOVED_TO;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (event == StandardWatchEventKind.ENTRY_DELETE) {
|
if (event == StandardWatchEventKinds.ENTRY_DELETE) {
|
||||||
mask |= IN_DELETE | IN_MOVED_FROM;
|
mask |= IN_DELETE | IN_MOVED_FROM;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (event == StandardWatchEventKind.ENTRY_MODIFY) {
|
if (event == StandardWatchEventKinds.ENTRY_MODIFY) {
|
||||||
mask |= IN_MODIFY | IN_ATTRIB;
|
mask |= IN_MODIFY | IN_ATTRIB;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -378,17 +378,17 @@ class LinuxWatchService
|
||||||
*/
|
*/
|
||||||
private WatchEvent.Kind<?> maskToEventKind(int mask) {
|
private WatchEvent.Kind<?> maskToEventKind(int mask) {
|
||||||
if ((mask & IN_MODIFY) > 0)
|
if ((mask & IN_MODIFY) > 0)
|
||||||
return StandardWatchEventKind.ENTRY_MODIFY;
|
return StandardWatchEventKinds.ENTRY_MODIFY;
|
||||||
if ((mask & IN_ATTRIB) > 0)
|
if ((mask & IN_ATTRIB) > 0)
|
||||||
return StandardWatchEventKind.ENTRY_MODIFY;
|
return StandardWatchEventKinds.ENTRY_MODIFY;
|
||||||
if ((mask & IN_CREATE) > 0)
|
if ((mask & IN_CREATE) > 0)
|
||||||
return StandardWatchEventKind.ENTRY_CREATE;
|
return StandardWatchEventKinds.ENTRY_CREATE;
|
||||||
if ((mask & IN_MOVED_TO) > 0)
|
if ((mask & IN_MOVED_TO) > 0)
|
||||||
return StandardWatchEventKind.ENTRY_CREATE;
|
return StandardWatchEventKinds.ENTRY_CREATE;
|
||||||
if ((mask & IN_DELETE) > 0)
|
if ((mask & IN_DELETE) > 0)
|
||||||
return StandardWatchEventKind.ENTRY_DELETE;
|
return StandardWatchEventKinds.ENTRY_DELETE;
|
||||||
if ((mask & IN_MOVED_FROM) > 0)
|
if ((mask & IN_MOVED_FROM) > 0)
|
||||||
return StandardWatchEventKind.ENTRY_DELETE;
|
return StandardWatchEventKinds.ENTRY_DELETE;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ class LinuxWatchService
|
||||||
if ((mask & IN_Q_OVERFLOW) > 0) {
|
if ((mask & IN_Q_OVERFLOW) > 0) {
|
||||||
for (Map.Entry<Integer,LinuxWatchKey> entry: wdToKey.entrySet()) {
|
for (Map.Entry<Integer,LinuxWatchKey> entry: wdToKey.entrySet()) {
|
||||||
entry.getValue()
|
entry.getValue()
|
||||||
.signalEvent(StandardWatchEventKind.OVERFLOW, null);
|
.signalEvent(StandardWatchEventKinds.OVERFLOW, null);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -486,7 +486,7 @@ class SolarisWatchService
|
||||||
void processDirectoryEvents(SolarisWatchKey key, int mask) {
|
void processDirectoryEvents(SolarisWatchKey key, int mask) {
|
||||||
if ((mask & (FILE_MODIFIED | FILE_ATTRIB)) != 0) {
|
if ((mask & (FILE_MODIFIED | FILE_ATTRIB)) != 0) {
|
||||||
registerChildren(key.getDirectory(), key,
|
registerChildren(key.getDirectory(), key,
|
||||||
key.events().contains(StandardWatchEventKind.ENTRY_CREATE));
|
key.events().contains(StandardWatchEventKinds.ENTRY_CREATE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,14 +504,14 @@ class SolarisWatchService
|
||||||
|
|
||||||
// entry modified
|
// entry modified
|
||||||
if (((mask & (FILE_MODIFIED | FILE_ATTRIB)) != 0) &&
|
if (((mask & (FILE_MODIFIED | FILE_ATTRIB)) != 0) &&
|
||||||
events.contains(StandardWatchEventKind.ENTRY_MODIFY))
|
events.contains(StandardWatchEventKinds.ENTRY_MODIFY))
|
||||||
{
|
{
|
||||||
key.signalEvent(StandardWatchEventKind.ENTRY_MODIFY, node.name());
|
key.signalEvent(StandardWatchEventKinds.ENTRY_MODIFY, node.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
// entry removed
|
// entry removed
|
||||||
if (((mask & (FILE_REMOVED)) != 0) &&
|
if (((mask & (FILE_REMOVED)) != 0) &&
|
||||||
events.contains(StandardWatchEventKind.ENTRY_DELETE))
|
events.contains(StandardWatchEventKinds.ENTRY_DELETE))
|
||||||
{
|
{
|
||||||
// Due to 6636438/6636412 we may get a remove event for cases
|
// Due to 6636438/6636412 we may get a remove event for cases
|
||||||
// where a rmdir/unlink/rename is attempted but fails. Until
|
// where a rmdir/unlink/rename is attempted but fails. Until
|
||||||
|
@ -527,7 +527,7 @@ class SolarisWatchService
|
||||||
} catch (UnixException x) { }
|
} catch (UnixException x) { }
|
||||||
|
|
||||||
if (removed)
|
if (removed)
|
||||||
key.signalEvent(StandardWatchEventKind.ENTRY_DELETE, node.name());
|
key.signalEvent(StandardWatchEventKinds.ENTRY_DELETE, node.name());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -547,7 +547,7 @@ class SolarisWatchService
|
||||||
// if the ENTRY_MODIFY event is not enabled then we don't need
|
// if the ENTRY_MODIFY event is not enabled then we don't need
|
||||||
// modification events for entries in the directory
|
// modification events for entries in the directory
|
||||||
int events = FILE_NOFOLLOW;
|
int events = FILE_NOFOLLOW;
|
||||||
if (parent.events().contains(StandardWatchEventKind.ENTRY_MODIFY))
|
if (parent.events().contains(StandardWatchEventKinds.ENTRY_MODIFY))
|
||||||
events |= (FILE_MODIFIED | FILE_ATTRIB);
|
events |= (FILE_MODIFIED | FILE_ATTRIB);
|
||||||
|
|
||||||
DirectoryStream<Path> stream = null;
|
DirectoryStream<Path> stream = null;
|
||||||
|
@ -567,7 +567,7 @@ class SolarisWatchService
|
||||||
|
|
||||||
// send ENTRY_CREATE if enabled
|
// send ENTRY_CREATE if enabled
|
||||||
if (sendEvents) {
|
if (sendEvents) {
|
||||||
parent.signalEvent(StandardWatchEventKind.ENTRY_CREATE, name);
|
parent.signalEvent(StandardWatchEventKinds.ENTRY_CREATE, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// register it
|
// register it
|
||||||
|
@ -602,12 +602,12 @@ class SolarisWatchService
|
||||||
// update events, rembering if ENTRY_MODIFY was previously
|
// update events, rembering if ENTRY_MODIFY was previously
|
||||||
// enabled or disabled.
|
// enabled or disabled.
|
||||||
boolean wasModifyEnabled = key.events()
|
boolean wasModifyEnabled = key.events()
|
||||||
.contains(StandardWatchEventKind.ENTRY_MODIFY);
|
.contains(StandardWatchEventKinds.ENTRY_MODIFY);
|
||||||
key.setEvents(events);
|
key.setEvents(events);
|
||||||
|
|
||||||
// check if ENTRY_MODIFY has changed
|
// check if ENTRY_MODIFY has changed
|
||||||
boolean isModifyEnabled = events
|
boolean isModifyEnabled = events
|
||||||
.contains(StandardWatchEventKind.ENTRY_MODIFY);
|
.contains(StandardWatchEventKinds.ENTRY_MODIFY);
|
||||||
if (wasModifyEnabled == isModifyEnabled) {
|
if (wasModifyEnabled == isModifyEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,15 +464,15 @@ class WindowsWatchService
|
||||||
{
|
{
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case FILE_ACTION_MODIFIED :
|
case FILE_ACTION_MODIFIED :
|
||||||
return StandardWatchEventKind.ENTRY_MODIFY;
|
return StandardWatchEventKinds.ENTRY_MODIFY;
|
||||||
|
|
||||||
case FILE_ACTION_ADDED :
|
case FILE_ACTION_ADDED :
|
||||||
case FILE_ACTION_RENAMED_NEW_NAME :
|
case FILE_ACTION_RENAMED_NEW_NAME :
|
||||||
return StandardWatchEventKind.ENTRY_CREATE;
|
return StandardWatchEventKinds.ENTRY_CREATE;
|
||||||
|
|
||||||
case FILE_ACTION_REMOVED :
|
case FILE_ACTION_REMOVED :
|
||||||
case FILE_ACTION_RENAMED_OLD_NAME :
|
case FILE_ACTION_RENAMED_OLD_NAME :
|
||||||
return StandardWatchEventKind.ENTRY_DELETE;
|
return StandardWatchEventKinds.ENTRY_DELETE;
|
||||||
|
|
||||||
default :
|
default :
|
||||||
return null; // action not recognized
|
return null; // action not recognized
|
||||||
|
@ -548,7 +548,7 @@ class WindowsWatchService
|
||||||
if (info.error() != 0) {
|
if (info.error() != 0) {
|
||||||
// buffer overflow
|
// buffer overflow
|
||||||
if (info.error() == ERROR_NOTIFY_ENUM_DIR) {
|
if (info.error() == ERROR_NOTIFY_ENUM_DIR) {
|
||||||
key.signalEvent(StandardWatchEventKind.OVERFLOW, null);
|
key.signalEvent(StandardWatchEventKinds.OVERFLOW, null);
|
||||||
} else {
|
} else {
|
||||||
// other error so cancel key
|
// other error so cancel key
|
||||||
implCancelKey(key);
|
implCancelKey(key);
|
||||||
|
@ -562,7 +562,7 @@ class WindowsWatchService
|
||||||
processEvents(key, info.bytesTransferred());
|
processEvents(key, info.bytesTransferred());
|
||||||
} else {
|
} else {
|
||||||
// insufficient buffer size
|
// insufficient buffer size
|
||||||
key.signalEvent(StandardWatchEventKind.OVERFLOW, null);
|
key.signalEvent(StandardWatchEventKinds.OVERFLOW, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// start read for next batch of changes
|
// start read for next batch of changes
|
||||||
|
|
|
@ -40,7 +40,7 @@ import com.sun.nio.sctp.SctpServerChannel;
|
||||||
import com.sun.nio.sctp.SctpSocketOption;
|
import com.sun.nio.sctp.SctpSocketOption;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import sun.security.action.GetPropertyAction;
|
import sun.security.action.GetPropertyAction;
|
||||||
import static com.sun.nio.sctp.SctpStandardSocketOption.*;
|
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
|
||||||
import static java.lang.System.out;
|
import static java.lang.System.out;
|
||||||
|
|
||||||
public class SocketOptionTests {
|
public class SocketOptionTests {
|
||||||
|
|
|
@ -48,7 +48,7 @@ import com.sun.nio.sctp.SctpServerChannel;
|
||||||
import com.sun.nio.sctp.SctpSocketOption;
|
import com.sun.nio.sctp.SctpSocketOption;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import sun.security.action.GetPropertyAction;
|
import sun.security.action.GetPropertyAction;
|
||||||
import static com.sun.nio.sctp.SctpStandardSocketOption.*;
|
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
|
||||||
import static java.lang.System.out;
|
import static java.lang.System.out;
|
||||||
|
|
||||||
public class SocketOptionTests {
|
public class SocketOptionTests {
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
import java.nio.channels.*;
|
import java.nio.channels.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import static java.net.StandardSocketOption.*;
|
import static java.net.StandardSocketOptions.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.*;
|
import java.nio.channels.*;
|
||||||
import static java.net.StandardSocketOption.*;
|
import static java.net.StandardSocketOptions.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
@ -383,7 +383,7 @@ public class Basic {
|
||||||
// write bytes and close connection
|
// write bytes and close connection
|
||||||
SocketChannel sc = server.accept();
|
SocketChannel sc = server.accept();
|
||||||
ByteBuffer src = genBuffer();
|
ByteBuffer src = genBuffer();
|
||||||
sc.setOption(StandardSocketOption.SO_SNDBUF, src.remaining());
|
sc.setOption(StandardSocketOptions.SO_SNDBUF, src.remaining());
|
||||||
while (src.hasRemaining())
|
while (src.hasRemaining())
|
||||||
sc.write(src);
|
sc.write(src);
|
||||||
sc.close();
|
sc.close();
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class BasicMulticastTests {
|
||||||
StandardProtocolFamily.INET : StandardProtocolFamily.INET6;
|
StandardProtocolFamily.INET : StandardProtocolFamily.INET6;
|
||||||
|
|
||||||
DatagramChannel dc = DatagramChannel.open(family)
|
DatagramChannel dc = DatagramChannel.open(family)
|
||||||
.setOption(StandardSocketOption.SO_REUSEADDR, true)
|
.setOption(StandardSocketOptions.SO_REUSEADDR, true)
|
||||||
.bind(new InetSocketAddress(source, 0));
|
.bind(new InetSocketAddress(source, 0));
|
||||||
|
|
||||||
// check existing key is returned
|
// check existing key is returned
|
||||||
|
@ -115,7 +115,7 @@ public class BasicMulticastTests {
|
||||||
System.out.println("Exception Tests");
|
System.out.println("Exception Tests");
|
||||||
|
|
||||||
DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)
|
DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)
|
||||||
.setOption(StandardSocketOption.SO_REUSEADDR, true)
|
.setOption(StandardSocketOptions.SO_REUSEADDR, true)
|
||||||
.bind(new InetSocketAddress(0));
|
.bind(new InetSocketAddress(0));
|
||||||
|
|
||||||
InetAddress group = InetAddress.getByName("225.4.5.6");
|
InetAddress group = InetAddress.getByName("225.4.5.6");
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class MulticastSendReceiveTests {
|
||||||
StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
|
StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
|
||||||
DatagramChannel dc = DatagramChannel.open(family)
|
DatagramChannel dc = DatagramChannel.open(family)
|
||||||
.bind(new InetSocketAddress(local, 0))
|
.bind(new InetSocketAddress(local, 0))
|
||||||
.setOption(StandardSocketOption.IP_MULTICAST_IF, nif);
|
.setOption(StandardSocketOptions.IP_MULTICAST_IF, nif);
|
||||||
int id = rand.nextInt();
|
int id = rand.nextInt();
|
||||||
byte[] msg = Integer.toString(id).getBytes("UTF-8");
|
byte[] msg = Integer.toString(id).getBytes("UTF-8");
|
||||||
ByteBuffer buf = ByteBuffer.wrap(msg);
|
ByteBuffer buf = ByteBuffer.wrap(msg);
|
||||||
|
@ -146,7 +146,7 @@ public class MulticastSendReceiveTests {
|
||||||
System.out.format("\nTest DatagramChannel to %s socket\n", family.name());
|
System.out.format("\nTest DatagramChannel to %s socket\n", family.name());
|
||||||
try (DatagramChannel dc = (family == UNSPEC) ?
|
try (DatagramChannel dc = (family == UNSPEC) ?
|
||||||
DatagramChannel.open() : DatagramChannel.open(family)) {
|
DatagramChannel.open() : DatagramChannel.open(family)) {
|
||||||
dc.setOption(StandardSocketOption.SO_REUSEADDR, true)
|
dc.setOption(StandardSocketOptions.SO_REUSEADDR, true)
|
||||||
.bind(new InetSocketAddress(0));
|
.bind(new InetSocketAddress(0));
|
||||||
|
|
||||||
// join group
|
// join group
|
||||||
|
|
|
@ -31,7 +31,7 @@ import java.nio.channels.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import static java.net.StandardSocketOption.*;
|
import static java.net.StandardSocketOptions.*;
|
||||||
|
|
||||||
public class SocketOptionTests {
|
public class SocketOptionTests {
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.nio.channels.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import static java.net.StandardSocketOption.*;
|
import static java.net.StandardSocketOptions.*;
|
||||||
|
|
||||||
public class SocketOptionTests {
|
public class SocketOptionTests {
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class Shutdown {
|
||||||
static void acceptAndReset(ServerSocketChannel ssc) throws IOException {
|
static void acceptAndReset(ServerSocketChannel ssc) throws IOException {
|
||||||
SocketChannel peer = ssc.accept();
|
SocketChannel peer = ssc.accept();
|
||||||
try {
|
try {
|
||||||
peer.setOption(StandardSocketOption.SO_LINGER, 0);
|
peer.setOption(StandardSocketOptions.SO_LINGER, 0);
|
||||||
peer.configureBlocking(false);
|
peer.configureBlocking(false);
|
||||||
peer.write(ByteBuffer.wrap(new byte[128*1024]));
|
peer.write(ByteBuffer.wrap(new byte[128*1024]));
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.nio.channels.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import static java.net.StandardSocketOption.*;
|
import static java.net.StandardSocketOptions.*;
|
||||||
|
|
||||||
public class SocketOptionTests {
|
public class SocketOptionTests {
|
||||||
|
|
||||||
|
|
|
@ -540,7 +540,7 @@ public class CheckPermissions {
|
||||||
|
|
||||||
try (WatchService watcher = FileSystems.getDefault().newWatchService()) {
|
try (WatchService watcher = FileSystems.getDefault().newWatchService()) {
|
||||||
prepare();
|
prepare();
|
||||||
testdir.register(watcher, StandardWatchEventKind.ENTRY_DELETE);
|
testdir.register(watcher, StandardWatchEventKinds.ENTRY_DELETE);
|
||||||
assertCheckRead(testdir);
|
assertCheckRead(testdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import static java.nio.file.StandardWatchEventKind.*;
|
import static java.nio.file.StandardWatchEventKinds.*;
|
||||||
import java.nio.file.attribute.*;
|
import java.nio.file.attribute.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -100,7 +100,7 @@ public class Basic {
|
||||||
// remove key and check that we got the ENTRY_CREATE event
|
// remove key and check that we got the ENTRY_CREATE event
|
||||||
takeExpectedKey(watcher, myKey);
|
takeExpectedKey(watcher, myKey);
|
||||||
checkExpectedEvent(myKey.pollEvents(),
|
checkExpectedEvent(myKey.pollEvents(),
|
||||||
StandardWatchEventKind.ENTRY_CREATE, name);
|
StandardWatchEventKinds.ENTRY_CREATE, name);
|
||||||
|
|
||||||
System.out.println("reset key");
|
System.out.println("reset key");
|
||||||
if (!myKey.reset())
|
if (!myKey.reset())
|
||||||
|
@ -121,7 +121,7 @@ public class Basic {
|
||||||
Files.delete(file);
|
Files.delete(file);
|
||||||
takeExpectedKey(watcher, myKey);
|
takeExpectedKey(watcher, myKey);
|
||||||
checkExpectedEvent(myKey.pollEvents(),
|
checkExpectedEvent(myKey.pollEvents(),
|
||||||
StandardWatchEventKind.ENTRY_DELETE, name);
|
StandardWatchEventKinds.ENTRY_DELETE, name);
|
||||||
|
|
||||||
System.out.println("reset key");
|
System.out.println("reset key");
|
||||||
if (!myKey.reset())
|
if (!myKey.reset())
|
||||||
|
@ -149,7 +149,7 @@ public class Basic {
|
||||||
// remove key and check that we got the ENTRY_MODIFY event
|
// remove key and check that we got the ENTRY_MODIFY event
|
||||||
takeExpectedKey(watcher, myKey);
|
takeExpectedKey(watcher, myKey);
|
||||||
checkExpectedEvent(myKey.pollEvents(),
|
checkExpectedEvent(myKey.pollEvents(),
|
||||||
StandardWatchEventKind.ENTRY_MODIFY, name);
|
StandardWatchEventKinds.ENTRY_MODIFY, name);
|
||||||
System.out.println("OKAY");
|
System.out.println("OKAY");
|
||||||
|
|
||||||
// done
|
// done
|
||||||
|
@ -424,7 +424,7 @@ public class Basic {
|
||||||
// check that key1 got ENTRY_CREATE
|
// check that key1 got ENTRY_CREATE
|
||||||
takeExpectedKey(watcher1, key1);
|
takeExpectedKey(watcher1, key1);
|
||||||
checkExpectedEvent(key1.pollEvents(),
|
checkExpectedEvent(key1.pollEvents(),
|
||||||
StandardWatchEventKind.ENTRY_CREATE, name2);
|
StandardWatchEventKinds.ENTRY_CREATE, name2);
|
||||||
|
|
||||||
// check that key2 got zero events
|
// check that key2 got zero events
|
||||||
WatchKey key = watcher2.poll();
|
WatchKey key = watcher2.poll();
|
||||||
|
@ -437,7 +437,7 @@ public class Basic {
|
||||||
// check that key2 got ENTRY_DELETE
|
// check that key2 got ENTRY_DELETE
|
||||||
takeExpectedKey(watcher2, key2);
|
takeExpectedKey(watcher2, key2);
|
||||||
checkExpectedEvent(key2.pollEvents(),
|
checkExpectedEvent(key2.pollEvents(),
|
||||||
StandardWatchEventKind.ENTRY_DELETE, name1);
|
StandardWatchEventKinds.ENTRY_DELETE, name1);
|
||||||
|
|
||||||
// check that key1 got zero events
|
// check that key1 got zero events
|
||||||
key = watcher1.poll();
|
key = watcher1.poll();
|
||||||
|
@ -458,7 +458,7 @@ public class Basic {
|
||||||
Files.createFile(file1);
|
Files.createFile(file1);
|
||||||
takeExpectedKey(watcher2, key2);
|
takeExpectedKey(watcher2, key2);
|
||||||
checkExpectedEvent(key2.pollEvents(),
|
checkExpectedEvent(key2.pollEvents(),
|
||||||
StandardWatchEventKind.ENTRY_CREATE, name1);
|
StandardWatchEventKinds.ENTRY_CREATE, name1);
|
||||||
|
|
||||||
System.out.println("OKAY");
|
System.out.println("OKAY");
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import static java.nio.file.StandardWatchEventKind.*;
|
import static java.nio.file.StandardWatchEventKinds.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import static java.nio.file.StandardWatchEventKind.*;
|
import static java.nio.file.StandardWatchEventKinds.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import static java.nio.file.StandardWatchEventKind.*;
|
import static java.nio.file.StandardWatchEventKinds.*;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class WithSecurityManager {
|
||||||
// attempt to register directory
|
// attempt to register directory
|
||||||
try {
|
try {
|
||||||
dir.register(dir.getFileSystem().newWatchService(),
|
dir.register(dir.getFileSystem().newWatchService(),
|
||||||
new WatchEvent.Kind<?>[]{ StandardWatchEventKind.ENTRY_CREATE },
|
new WatchEvent.Kind<?>[]{ StandardWatchEventKinds.ENTRY_CREATE },
|
||||||
modifiers);
|
modifiers);
|
||||||
if (expectedToFail)
|
if (expectedToFail)
|
||||||
throw new RuntimeException("SecurityException not thrown");
|
throw new RuntimeException("SecurityException not thrown");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue