How to build a high quality Client/Server Java application – a Java Chat Client/Server example Part2
March 8th, 2006Part1 , 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:
Run the server first, then the client.
Java,/client/server,course,chat,sockets,network
March 8th, 2006 at 2:09 pm
[...] Part 2 Java,/client/server,course,chat,sockets,network [...]
March 15th, 2006 at 10:43 am
[...] Part1 Part2 [...]
March 20th, 2006 at 3:13 pm
[...] Part1 , Part2 , Part3 , Part4 [...]
April 6th, 2006 at 10:35 am
[...] Part1 , Part2 , Part3 , Part4 ,Part5 [...]