Ive never done any java networking stuff at all so im looking for a basic bit of code (or tutorial) that shows how to setup a game server, which can recieve data from a client and display it on a 2nd client.
For example, a simple program that u type in a msg and when u hit send, the msg will be displyed on the other client.
Thanks.
There is some general client and server code in the following library
http://www.scottshaver2000.com/template/template.php?page=planetation_main
Take a look at the code in the com\sas\util\socket, com\sas\planetation\clients and com\sas\planetation\servers packages. This is the old way to do things the new NIO packages allow for better scaling.
Works something like this:
1> Start server listening thread, listens for connections on specified port.
2> When a client connects spawn a new thread to handle that clients connection
3> goto 1