Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

exeception java.net.ConnectException: Connection refused: connect

800408Jun 26 2009 — edited Jun 26 2009
hi all,
when i making the simple socket like:

try {
Socket socket = new Socket("192.168.2.101", 2004);
System.out.println("client connect to server ");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

im getting the following exception:
"*java.net.ConnectException: Connection refused: connect*"

what can be the problem?
i assume the problem is not in my code but somthing that do with my operating system.
TIA
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2009
Added on Jun 26 2009
3 comments
142 views