check this out.
like this, there is no loop or so, but you can see what you type in at the client will be received by the server. Now just do whatever you wanted to do with the data coming in at the server.
One caveat. When you run the client from an
IDE, you might get problems because sometimes, STDIN (java.lang.System.in) is not readable (BufferedReader.readLine() in the client then returns immediately). I have this problem when I use my Netbeans IDE. Netbeans uses
Ant for running a project, and by default you don't have a console (there is some kind of switch you can set in the "java" ant task, it's attribute "fork" which you probably have to set to "true" if you wanna use the Netbeans console as STDIN; see manual:
http://ant.apache.org/manual/index.html). I recommend testing from the command line.
[ September 28, 2005: Message edited by: Dennis K�hn ]