38 |
package java.net; |
package java.net; |
39 |
|
|
40 |
import java.io.IOException; |
import java.io.IOException; |
41 |
|
import java.nio.channels.IllegalBlockingModeException; |
42 |
|
import java.nio.channels.ServerSocketChannel; |
43 |
|
|
44 |
/* Written using on-line Java Platform 1.2 API Specification. |
/* Written using on-line Java Platform 1.2 API Specification. |
45 |
* Status: I believe all methods are implemented. |
* Status: I believe all methods are implemented. |
51 |
* listens for and accepts connections. At that point the client and |
* listens for and accepts connections. At that point the client and |
52 |
* server sockets are ready to communicate with one another utilizing |
* server sockets are ready to communicate with one another utilizing |
53 |
* whatever application layer protocol they desire. |
* whatever application layer protocol they desire. |
54 |
* <p> |
* |
55 |
* As with the <code>Socket</code> class, most instance methods of this class |
* As with the <code>Socket</code> class, most instance methods of this class |
56 |
* simply redirect their calls to an implementation class. |
* simply redirect their calls to an implementation class. |
57 |
* |
* |
77 |
private SocketImpl impl; |
private SocketImpl impl; |
78 |
|
|
79 |
/** |
/** |
80 |
* Private constructor that simply sets the implementation. |
* Constructor that simply sets the implementation. |
81 |
|
* |
82 |
|
* @exception IOException If an error occurs |
83 |
|
* |
84 |
|
* @specnote This constructor is public since JDK 1.4 |
85 |
*/ |
*/ |
86 |
private ServerSocket() |
public ServerSocket() throws IOException |
87 |
{ |
{ |
88 |
if (factory != null) |
if (factory != null) |
89 |
impl = factory.createSocketImpl(); |
impl = factory.createSocketImpl(); |
99 |
* @param port The port number to bind to |
* @param port The port number to bind to |
100 |
* |
* |
101 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
102 |
|
* @exception SecurityException If a security manager exists and its |
103 |
|
* checkListen method doesn't allow the operation |
104 |
*/ |
*/ |
105 |
public ServerSocket (int port) |
public ServerSocket (int port) |
106 |
throws java.io.IOException |
throws IOException |
107 |
{ |
{ |
108 |
this(port, 50); |
this(port, 50); |
109 |
} |
} |