> " Also, the echo server should be running on your host."
>
> I'm sorry but how can I set up the echo server on my host? I'm using
> Windows XP.
You maybe better as this on a Windows group. AFAIK Windows Server
edition has an echo server as part of the "Simple TCP/IP Services",
which one can configure somewhere. I have no idea if there is something
similar in XP.
If you can't find anything, you can maybe try the very simple server
given at the end of
http://www.javaworld.com/jw-12-1996/jw-12-sockets-p2.html
It listens on a different port, but it should be easy to change this in
your client.
A general remark: Sun's networking tutorial is rather bad. it is maybe
ok for some first steps, but it is fare from complete, and has some ugly
errors. So, you probably want to read some more about TCP/IP in general.
/Thomas
jieshuang@gmail.com - 19 Apr 2006 09:55 GMT
Thank you. Echo server is not so important to me. I just want to learn
basic network programming in serveral weeks. Your link is useful,
although it seems that the "echo server" in it does not have port 7,
and it still use InputDataStream which is reported as too old by javac.
I know to be expert in network, some books like Steven's is essential.
But you know, English is my second language and I have to work and have
to learn to cheat for job(network and database is hot, so I have to
learn basic of them and do several project). I have not much time.
Thomas Weidenfeller - 19 Apr 2006 10:53 GMT
> have to work and have
> to learn to cheat for job
Don't do that. There are more than enough bad behaving network
applications out there. Some of them create real problems (e.g. recently
http://people.freebsd.org/~phk/dlink/).
Or see http://www.norvig.com/21-days.html
/Thomas
Roedy Green - 20 Apr 2006 01:45 GMT
On 19 Apr 2006 01:55:43 -0700, "jieshuang@gmail.com"
<jieshuang@gmail.com> wrote, quoted or indirectly quoted someone who
said :
>English is my second language and I have to work and have
>to learn to cheat for job
Some proverbs would be appropriate here.
This approach simply does not work in computers. A brilliant
psychologist Chris Rainey (who suddenly dropped dead of a brain tumor)
proved this to many years ago when I was absolutely frazzled trying to
meet deadlines.
He persuaded me to, just as an short term experiment, be lazy and
deliberately take too much time to complete each task.
Of course in this relaxed environment I made very few errors and
everything worked first time. My productivity soared. I did not have
to do anything over. I wrote easy-to-maintain code. I stopped wasting
time flapping my arms muttering "I HAVE to get this finished." Without
the adrenalin, I could think clearly and logically.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
mlody277 - 19 Apr 2006 10:05 GMT
Hallo I am new at this group but in my opinion :
First of all You have to create a server application at the same port
like a client and start it than You can start the EchoClient class.
You receive the exceptions because there is no machine( server ) which
can serve requests from EchoClient
The other problem is that in the line:
echoSocket = new Socket("taranis", 7);
you use the post = 7. The ports between 0 and 1024 are reserved for the
system, so please use some biger number.
If you want to lunch this cod locally at Your computer use "localhost"
not "taranis"
I believe that this post help You.
Best regarst
mlody277
jieshuang@gmail.com - 20 Apr 2006 04:33 GMT
Thanks you. Yes, troubles are caused by the unexisting echo server,
whose port is 7 (but "use some biger number" if it will create a
server, not a client, I think). I now create server myself in program
for study purpose. Gone away echo server with port 7~~~