O'Reilly logo

Beginning Java 8 APIs, Extensions and Libraries Swing, JavaFX, JavaScript, JDBC and Network Programming APIs by Kishori Sharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting the Server and the Client Together

At this point, your asynchronous server and client programs are ready. You need to use the following steps to run the server and the client.

Running the Server Application

Run the AsyncEchoServerSocket class as listed in Listing 5-16. You should get a message on the standard output as follows:

Server is listening at localhost/127.0.0.1:8989

If you get the above message, you need to proceed to the next step. If you do not get the above message, it is most likely that the port 8989 is being used by another process. In such a case, you should get the following error message:

java.net.BindException: Address already in use: bind

If you get “Address already in use” error message, you need to change the port ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required