previous
|
start
|
next
A Server Program
The server waits for the client to connect on a certain port. We choose 8888
To listen for incoming connections, use a server socket
To construct a server socket, provide the port number
ServerSocket server = new ServerSocket(8888);
Use the
accept
method to wait for client connection and obtain a socket
Socket s = server.accept();
previous
|
start
|
next