GeezerVison is showing docs.oracle.com — ServerSocket (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact1, compact2, compact3
java.net
Class ServerSocket
-
-
Constructor Summary
Constructors
| Constructor |
Description |
ServerSocket() |
Creates an unbound server socket.
|
ServerSocket(int port) |
Creates a server socket, bound to the specified port.
|
ServerSocket(int port,
int backlog) |
Creates a server socket and binds it to the specified local port
number, with the specified backlog.
|
ServerSocket(int port,
int backlog,
InetAddress bindAddr) |
Create a server with the specified port, listen backlog, and
local IP address to bind to.
|
-
-
Method Detail
-
implAccept
protected final void implAccept(Socket s)
throws IOException
Subclasses of ServerSocket use this method to override accept()
to return their own subclass of socket. So a FooServerSocket
will typically hand this method an empty FooSocket. On
return from implAccept the FooSocket will be connected to a client.
- Parameters:
s - the Socket
- Throws:
IllegalBlockingModeException - if this socket has an associated channel,
and the channel is in non-blocking mode
IOException - if an I/O error occurs when waiting
for a connection.
- Since:
- JDK1.1
-
toString
public String toString()
Returns the implementation address and implementation port of
this socket as a String.
If there is a security manager set, its checkConnect method is
called with the local address and -1 as its arguments to see
if the operation is allowed. If the operation is not allowed,
an InetAddress representing the
loopback address is returned as
the implementation address.
- Overrides:
toString in class Object
- Returns:
- a string representation of this socket.
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|