< prev index next >

src/java.base/share/classes/java/net/SocketImpl.java

Print this page




 379      *         latency
 380      *
 381      * @param  bandwidth
 382      *         An {@code int} expressing the relative importance of high
 383      *         bandwidth
 384      *
 385      * @since 1.5
 386      */
 387     protected void setPerformancePreferences(int connectionTime,
 388                                           int latency,
 389                                           int bandwidth)
 390     {
 391         /* Not implemented yet */
 392     }
 393 
 394     /**
 395      * Called to set a socket option.
 396      *
 397      * @implSpec
 398      * The default implementation of this method first checks that the given
 399      * socket option {@code name} is not null, then throws {@code
 400      * UnsupportedOperationException}. Subclasses should override this method
 401      * with an appropriate implementation.
 402      *
 403      * @param <T> The type of the socket option value
 404      * @param name The socket option
 405      * @param value The value of the socket option. A value of {@code null}
 406      *              may be valid for some options.
 407      *
 408      * @throws UnsupportedOperationException if the SocketImpl does not
 409      *         support the option
 410      * @throws IllegalArgumentException if the value is not valid for
 411      *         the option
 412      * @throws IOException if an I/O error occurs, or if the socket is closed
 413      * @throws NullPointerException if name is {@code null}
 414      *
 415      * @since 9
 416      */
 417     protected <T> void setOption(SocketOption<T> name, T value) throws IOException {
 418         Objects.requireNonNull(name);
 419         throw new UnsupportedOperationException("'" + name + "' not supported");
 420     }
 421 
 422     /**
 423      * Called to get a socket option.
 424      *
 425      * @implSpec
 426      * The default implementation of this method first checks that the given
 427      * socket option {@code name} is not null, then throws {@code
 428      * UnsupportedOperationException}. Subclasses should override this method
 429      * with an appropriate implementation.
 430      *
 431      * @param <T> The type of the socket option value
 432      * @param name The socket option
 433      * @return the value of the named option
 434      *
 435      * @throws UnsupportedOperationException if the SocketImpl does not
 436      *         support the option
 437      * @throws IOException if an I/O error occurs, or if the socket is closed
 438      * @throws NullPointerException if name is {@code null}
 439      *
 440      * @since 9
 441      */
 442     protected <T> T getOption(SocketOption<T> name) throws IOException {
 443         Objects.requireNonNull(name);
 444         throw new UnsupportedOperationException("'" + name + "' not supported");
 445     }
 446 
 447     /**




 379      *         latency
 380      *
 381      * @param  bandwidth
 382      *         An {@code int} expressing the relative importance of high
 383      *         bandwidth
 384      *
 385      * @since 1.5
 386      */
 387     protected void setPerformancePreferences(int connectionTime,
 388                                           int latency,
 389                                           int bandwidth)
 390     {
 391         /* Not implemented yet */
 392     }
 393 
 394     /**
 395      * Called to set a socket option.
 396      *
 397      * @implSpec
 398      * The default implementation of this method first checks that the given
 399      * socket option {code name} is not null, then throws {@code
 400      * UnsupportedOperationException}. Subclasses should override this method
 401      * with an appropriate implementation.
 402      *
 403      * @param <T> The type of the socket option value
 404      * @param name The socket option
 405      * @param value The value of the socket option. A value of {@code null}
 406      *              may be valid for some options.
 407      *
 408      * @throws UnsupportedOperationException if the SocketImpl does not
 409      *         support the option
 410      * @throws IllegalArgumentException if the value is not valid for
 411      *         the option
 412      * @throws IOException if an I/O error occurs, or if the socket is closed
 413      * @throws NullPointerException if name is {@code null}
 414      *
 415      * @since 9
 416      */
 417     protected <T> void setOption(SocketOption<T> name, T value) throws IOException {
 418         Objects.requireNonNull(name);
 419         throw new UnsupportedOperationException("'" + name + "' not supported");
 420     }
 421 
 422     /**
 423      * Called to get a socket option.
 424      *
 425      * @implSpec
 426      * The default implementation of this method first checks that the given
 427      * socket option {code name} is not null, then throws {@code
 428      * UnsupportedOperationException}. Subclasses should override this method
 429      * with an appropriate implementation.
 430      *
 431      * @param <T> The type of the socket option value
 432      * @param name The socket option
 433      * @return the value of the named option
 434      *
 435      * @throws UnsupportedOperationException if the SocketImpl does not
 436      *         support the option
 437      * @throws IOException if an I/O error occurs, or if the socket is closed
 438      * @throws NullPointerException if name is {@code null}
 439      *
 440      * @since 9
 441      */
 442     protected <T> T getOption(SocketOption<T> name) throws IOException {
 443         Objects.requireNonNull(name);
 444         throw new UnsupportedOperationException("'" + name + "' not supported");
 445     }
 446 
 447     /**


< prev index next >