File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

What is wrong?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
  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:
subject: simple socket mechanism
It's not a secret anymore!