set the system property
 "sun.net.inetaddr.ttl" to what you want. no negative value however.





-----Original Message-----
From: Lyubomir Pashov [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 4:57 PM
To: [EMAIL PROTECTED]
Subject: Re: How to set the URLConnection time out?


>>> what are you writing back to the client (from where you are opening this
>>> URLConnection) from the servlet?
>>> if it is null, then it could be the problem.

No, I don't open this URLConnection from the servlet.
I open it from the client, and it is not null, when I'm trying to access
it - I think NullPointerException will occur if it is null.

>>> could you please post the servlet code?

I think it is not necessary to post the servlet's code, because the problem
appears in client. Instead, I'll post the client's part where the
ConnectException occurs:

-----
   URL url = new URL(myReq.getURL());
   URLConnection conn = url.openConnection();
   if (myReq.getData() != null) {
      String data = (String) myReq.getData();
      conn.setDoOutput(true);
      PrintWriter out = new PrintWriter(conn.getOutputStream());
      out.println(data);
      out.flush();
      out.close();
   }
   myReq.getCallback().read(new BufferedReader(new
InputStreamReader(conn.getInputStream())));
-----

ConnectException occurs at the sixth line from the code snipped.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to