33 import java.nio.channels.spi.SelectorProvider; 34 35 /** 36 * A selectable channel for stream-oriented listening sockets. 37 * 38 * <p> A server-socket channel is created by invoking the {@link #open() open} 39 * method of this class. It is not possible to create a channel for an arbitrary, 40 * pre-existing {@link ServerSocket}. A newly-created server-socket channel is 41 * open but not yet bound. An attempt to invoke the {@link #accept() accept} 42 * method of an unbound server-socket channel will cause a {@link NotYetBoundException} 43 * to be thrown. A server-socket channel can be bound by invoking one of the 44 * {@link #bind(java.net.SocketAddress,int) bind} methods defined by this class. 45 * 46 * <p> Socket options are configured using the {@link #setOption(SocketOption,Object) 47 * setOption} method. Server-socket channels support the following options: 48 * <blockquote> 49 * <table class="striped"> 50 * <caption style="display:none">Socket options</caption> 51 * <thead> 52 * <tr> 53 * <th>Option Name</th> 54 * <th>Description</th> 55 * </tr> 56 * </thead> 57 * <tbody> 58 * <tr> 59 * <td> {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} </td> 60 * <td> The size of the socket receive buffer </td> 61 * </tr> 62 * <tr> 63 * <td> {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} </td> 64 * <td> Re-use address </td> 65 * </tr> 66 * </tbody> 67 * </table> 68 * </blockquote> 69 * Additional (implementation specific) options may also be supported. 70 * 71 * <p> Server-socket channels are safe for use by multiple concurrent threads. 72 * </p> 73 * 74 * @author Mark Reinhold 75 * @author JSR-51 Expert Group 76 * @since 1.4 77 */ 78 79 public abstract class ServerSocketChannel 80 extends AbstractSelectableChannel 81 implements NetworkChannel 82 { 83 | 33 import java.nio.channels.spi.SelectorProvider; 34 35 /** 36 * A selectable channel for stream-oriented listening sockets. 37 * 38 * <p> A server-socket channel is created by invoking the {@link #open() open} 39 * method of this class. It is not possible to create a channel for an arbitrary, 40 * pre-existing {@link ServerSocket}. A newly-created server-socket channel is 41 * open but not yet bound. An attempt to invoke the {@link #accept() accept} 42 * method of an unbound server-socket channel will cause a {@link NotYetBoundException} 43 * to be thrown. A server-socket channel can be bound by invoking one of the 44 * {@link #bind(java.net.SocketAddress,int) bind} methods defined by this class. 45 * 46 * <p> Socket options are configured using the {@link #setOption(SocketOption,Object) 47 * setOption} method. Server-socket channels support the following options: 48 * <blockquote> 49 * <table class="striped"> 50 * <caption style="display:none">Socket options</caption> 51 * <thead> 52 * <tr> 53 * <th scope="col">Option Name</th> 54 * <th scope="col">Description</th> 55 * </tr> 56 * </thead> 57 * <tbody> 58 * <tr> 59 * <th scope="row"> {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} </th> 60 * <td> The size of the socket receive buffer </td> 61 * </tr> 62 * <tr> 63 * <th scope="row"> {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} </th> 64 * <td> Re-use address </td> 65 * </tr> 66 * </tbody> 67 * </table> 68 * </blockquote> 69 * Additional (implementation specific) options may also be supported. 70 * 71 * <p> Server-socket channels are safe for use by multiple concurrent threads. 72 * </p> 73 * 74 * @author Mark Reinhold 75 * @author JSR-51 Expert Group 76 * @since 1.4 77 */ 78 79 public abstract class ServerSocketChannel 80 extends AbstractSelectableChannel 81 implements NetworkChannel 82 { 83 |