DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23746>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23746

SocketClient.setDefaultTimeout has no effect

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |



------- Additional Comments From [EMAIL PROTECTED]  2003-10-12 15:43 -------
Well, I probably explained myself badly, but it was intended that 
setDefaultTimout is called BEFORE calling connect.

The following code shows the problem(terraform.servebeer.com is actually down 
so the connetion attempt will fail).

/* CODE */
import org.apache.commons.net.telnet.TelnetClient;

public class AbortConnectionTest {
  static long start;

  public static void main(String[] args) {              
    TelnetClient client = new TelnetClient();
    try {               
      client.setDefaultTimeout(5000);  // No effect?
      start = System.currentTimeMillis();
      client.connect("terraform.servebeer.com");
      client.disconnect();
    } catch(Exception e) {
      System.out.println(System.currentTimeMillis() - start);
      System.out.println(e);
    }
  }
}
/* END CODE */

When the code is executed the output is
21219
java.net.ConnectException: Connection timed out: connect

instead of 

5000
java.net.ConnectException: Connection timed out: connect

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

Reply via email to