How to build a high quality Client/Server Java application – a Java Chat Client/Server example Part2

March 8th, 2006

Part1 , Part2 , Part3 , Part4 ,Part5

Well since it is a network application, we should start by writing some simple network code to make sure that we fully understand the technology.

The first simple code we are going to write is an application that a client sends one message across the net and the server gets that message and prints it out.

In order for you to send a message across the internet you need two things the IP address of the machine and the port number the server is listening at. You see all internet based software listens to a port. For example Web servers listen to port 80.

The IP address we are going to use is “localhost” which means your current local machine/desktop. The IP address we are choosing is 51234. We could have picked any number above 1024.

Here is the example:

Client1

Server1

Run the server first, then the client.


Java,/client/server,course,chat,sockets,network

4 Responses to 'How to build a high quality Client/Server Java application – a Java Chat Client/Server example Part2'

  1. Great Tasting Java » Blog Archive » How to build a high quality Client/Server Java application - a Java Chat Client/Server example Part1 says:

    March 8th, 2006 at 2:09 pm

    [...] Part 2 Java,/client/server,course,chat,sockets,network [...]

  2. Great Tasting Java » Blog Archive » How to build a high quality Client/Server Java application - a Java Chat Client/Server example Part3 says:

    March 15th, 2006 at 10:43 am

    [...] Part1 Part2 [...]

  3. Great Tasting Java » Blog Archive » How to build a high quality Client/Server Java application - a Java Chat Client/Server example Part4 says:

    March 20th, 2006 at 3:13 pm

    [...] Part1 , Part2 , Part3 , Part4 [...]

  4. Great Tasting Java » Blog Archive » How to build a high quality Client/Server Java application - a Java Chat Client/Server example Part5 says:

    April 6th, 2006 at 10:35 am

    [...] Part1 , Part2 , Part3 , Part4 ,Part5 [...]

Leave a Comment