I am trying this simple tutorial from oracle : http://www.oracle.com/technetwork/java/socket-140484.html (the Example 1 ). Here you have the two classes, SocketServer.java and SocketClient.java. When I run the client ( after I started the server), I get "Unknown host: kq6py.eng" in the console. I am on MAC OS X. What should I do? I tried setting the proxy settings in Eclipse but nothing changed.
Asked
Active
Viewed 818 times
-2
-
1Set the hostname to something you can resolve. (Likely localhost if you're running all that on the same machine.) – Mat Mar 26 '12 at 07:37
-
1Try IP instead of not-existing hostname. – rkosegi Mar 26 '12 at 07:39
-
Yes, that was it! So stupid of me :) Thanks a lot! – Teo Mar 26 '12 at 07:39
1 Answers
0
It's written The listenSocket method first creates a Socket object with the computer name ( kq6py) and port number (4321)
I doubt you got the same computer name as the example, so you should replace it by your computer name.

Michael Laffargue
- 10,116
- 6
- 42
- 76