In message <[EMAIL PROTECTED]>, cthulhu writes:
>So the purpose of setDefaultTimeout is to set SoTimeout when the socket 
>has not yet been opened, and the purpose of setSoTimeout is to set 
>SoTimeout when socket has been opened, right?

Yes.

>If so, I found the API description of setDefaultTimeout a little bit 
>misleading..

I agree and that's why I don't want to close the report.  I just haven't
thought of how to reword it.

>and another tought; why is  necessary to have 2 different 
>methods doing the same thing? I mean, why not having only setSoTimeout 
>and making it able to set SoTimout before and after socket is opened?

The reason is that it is very common to create a SocketClient instance
(say FTPClient for example) and reuse the object to establish
connections.  setDefaultTimeout is just a convenience method so you
can set the timeout once and have it set every time you establish
a connection.

>I then browsed a little the Socket API and Sun forum and it seems 
>there's no way(at least I found none) to set how long it takes for a 

There's a connect method in J2SE 1.4 that takes a timeout argument.
The problem is that we haven't decided to break compatibility with
earlier Java versions, so we haven't added a comparable method to
SocketClient.  But you're free to change the source to SocketClient
and add a setDefaultConnectTimeout method or a connect method that
takes a timeout argument to suit your purposes.

daniel



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to