aspose file tools*
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
Author

simple socket mechanism

Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804
    
    1

Hi, I am totally new with Sockets.

Firstly, please have a look at the code.

Server


Client


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

What is wrong?

SCJP6, SCWCD5, OCE:EJBD6.
BLOG: http://leakfromjavaheap.blogspot.com
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41818
    
  62
0.0.0.0 is not the address of the localhost; try 127.0.0.1.


Ping & DNS - my free Android networking tools app
Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804
    
    1

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