public class EchoServer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
EchoServer.ClientConnection
Handler for each client connection to the server.
|
| Constructor and Description |
|---|
EchoServer(int port)
Constructs a new instance that binds to the given port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static void |
main(String[] args)
Main method to run the server, the first argument is an optional port number.
|
int |
port() |
void |
run()
Starts the main server event loop.
|
public EchoServer(int port)
throws IOException
IOExceptionpublic static void main(String[] args) throws Exception
Exceptionpublic int port()
public void run()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2024 The Apache Software Foundation. All rights reserved.