ServerSocket
public
class
ServerSocket
extends Object
implements
Closeable
| java.lang.Object | |
| ↳ | java.net.ServerSocket |
This class implements server sockets. A server socket waits for requests to come in over the network. It performs some operation based on that request, and then possibly returns a result to the requester.
The actual work of the server socket is performed by an instance
of the SocketImpl class. An application can
change the socket factory that creates the socket
implementation to configure itself to create sockets
appropriate to the local firewall.
Summary
Public constructors | |
|---|---|
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. |
|
Public methods | |
|---|---|
Socket
|
accept()
Listens for a connection to be made to this socket and accepts it. |
void
|
bind(SocketAddress endpoint, int backlog)
Binds the |
void
|
bind(SocketAddress endpoint)
Binds the |
void
|
close()
Closes this socket. |
ServerSocketChannel
|
getChannel()
Returns the unique |
| |