jQuery in Action, 3rd edition
The moose likes Sockets and Internet Protocols and the fly likes simple socket mechanism Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "simple socket mechanism" Watch "simple socket mechanism" New topic

simple socket mechanism

Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 808

Hi, I am totally new with Sockets.

Firstly, please have a look at the code.



I start Server through: java Server
Next I open the second console and I start client: java Client
And I get java.net.UnknownHostException:

What is wrong?

BLOG: http://leakfromjavaheap.blogspot.com
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
  73 is not the address of the localhost; try
Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 808

OK, thanks. It works.
But toString() method of SocketServer printed that the host address is:, so what about that?
I agree. Here's the link: http://aspose.com/file-tools
subject: simple socket mechanism
It's not a secret anymore!