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 Socket connection problem 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 "Socket connection problem" Watch "Socket connection problem" New topic

Socket connection problem

Arun Prasath
Ranch Hand

Joined: Jul 18, 2006
Posts: 60
Socket s=new Socket(i,1024);

it gives ConnectException and says connection refuses.
how can it be cleared?
Petrus Pelser
Ranch Hand

Joined: Feb 20, 2006
Posts: 132
What is i's type and value?
Chris Beckey
Ranch Hand

Joined: Jun 09, 2006
Posts: 116

Most likely it means that the host at "i" is not listening on the specified port (1024).
I agree. Here's the link:
subject: Socket connection problem
It's not a secret anymore!