Re: How to set the URLConnection time out?

Sandeep Gain <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.