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!

How can I set the timeout of a Socket ?

843790Jul 7 2010 — edited Jul 7 2010
I write a p2p aplication without a central server its a kind of an encrypted comunication Tool my Problem is that the Socket
java.net.ConnectException: Connection timed out: connect because the Server on the other side is not ready but the period of time to conect ist to short you have to start the programms at the Clients nearly at the same time and that is impossible.
so i have to increase the rate of time elapse till the socket throws the exception an infinty time would be best.
I did not found souch a method did i overlocked something and if there is realy no one can i see the sources of Socket or extend from it to create my owen?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2010
Added on Jul 7 2010
4 comments
255 views