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
IOException
public static void main(String[] args) throws Exception
Exception
public int port()
public void run() throws IOException
IOException
public void close() throws IOException
IOException
Copyright © 2023 The Apache Software Foundation. All rights reserved.