aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes java.net.ConnectException: Connection timed out: connect 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 "java.net.ConnectException: Connection timed out: connect" Watch "java.net.ConnectException: Connection timed out: connect" New topic
Author

java.net.ConnectException: Connection timed out: connect

Bhuvana Raj
Ranch Hand

Joined: Sep 07, 2006
Posts: 74
Hi all,

It is a client server program using applet and socket. We are using applet in the client side & socket for communication to server.

In XP OS SP2 the socket object is not created and throws java.net.ConnectException: Connection timed out: connect.

Is it due to firewall that blocks port?

Thanks,
Bhuvana
[ November 02, 2007: Message edited by: Bhuvana Raj ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

Is XP the server or the client?
I don't think XP's integral firewall blocks outgoing connections like more sophisticated firewalls (ZoneAlarm, for instance) do, so if XP is the client, I wouldn't blame the firewall.
In any case, the XP firewall is easy enough to turn off that you should be able to quickly test if it is the source of your problem.


[How To Ask Questions On JavaRanch]
Bhuvana Raj
Ranch Hand

Joined: Sep 07, 2006
Posts: 74
Hi,
Thanks for your reply.

Client OS is Windows XP SP2.Server is Windows 2003 Server. For example, Server is running in the port 2000. Client tries to communicate to this port number but fails and throws: java.net.ConnectException: Connection timed out: connect.

It fail at this line: socketObject = new Socket(host,port); Before this line it prints the correct port number 2000 and the host name.

Please help me

Regards,
Bhuvana
[ November 03, 2007: Message edited by: Bhuvana Raj ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

Is this problem specific to WinXP clients? Do you have other clients that can connect successfully?
Does your Windows 2003 server have a firewall (the answer to this question had better be "YES")? Is it properly configured?
Is your server in a DMZ or are there firewalls or proxies between your client and server?
Bhuvana Raj
Ranch Hand

Joined: Sep 07, 2006
Posts: 74
Originally posted by Joe Ess:
Is this problem specific to WinXP clients? Do you have other clients that can connect successfully?
Does your Windows 2003 server have a firewall (the answer to this question had better be "YES")? Is it properly configured?
Is your server in a DMZ or are there firewalls or proxies between your client and server?


Hi Joe,

The problem is solved. The network from which we tried to access the Server has firewall problem that blocks in creating the socket from one network to other.

We tried in stand alone XP systems and found to be working.

Kindly let me know if you have any questions.

Regards,
Bhuvana
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.net.ConnectException: Connection timed out: connect