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!

Socket Connection Timeout issue

843790Dec 28 2006 — edited Dec 29 2006
Can anyone explain how I can get a ConnectionException that states as the reason "conntection timed out" when I try to connect a socket without setting the timeout parameter?

socket = new Socket();
SocketAddress sAddr = new InetSocketAddress(host, port);
socket.connect( sAddr );

gives me:
java.net.ConnectException: Connection timed out

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 26 2007
Added on Dec 28 2006
3 comments
545 views