Sitemap

Amicuk Programming Answers

Http Request through URL Connection?

-0001-11-30   Views:0

Advertisement

Hi , Iam using an Applet (under JRE 1.3.0). Iam trying to send a Http Request using URL Connection. It is working fine . However, if the response time of the server is more than 3 minutes , the Response is not coming back to the server and the Applet

Hi ,
Iam using an Applet (under JRE 1.3.0). Iam trying to send a Http Request using URL Connection. It is working fine . However, if the response time of the server is more than 3 minutes , the Response is not coming back to the server and the Applet is in a loop trying to read from the Server. I have observed that the request is sent to the server and it is processed successfully.
When I test it in my local devp. machine it is working fine till 15 minutes which is my requirement.
Can anybody suggest what should be the possible reasons and any workaround for it?
Regards,
TejoKiran.Y

The replay answer
Advertisement
Iam copying the code fragments for the Applet Iam using . Is it a problem with the code? I heard that the URLConnection never times out . How is that it is not able to read the Response?
<CODE >
<HttpMessage>
public class HttpMessage {
URL servlet = null;
Hashtable headers = null;
public HttpMessage(URL servlet) {
this.servlet = servlet;
public InputStream sendGetMessage(Properties args) throws IOException {
String argString = ""; // default
if (args != null) {
argString = "?" + toEncodedString(args);
URL url = new URL(servlet.toExternalForm() + argString);
// Turn off caching
URLConnection con = url.openConnection();
con.setUseCaches(false);
// Send headers
sendHeaders(con);
return con.getInputStream();
private void sendHeaders(URLConnection con) {
if (headers != null) {
Enumeration enum = headers.keys();
while (enum.hasMoreElements()) {
String name = (String) enum.nextElement();
String value = (String) headers.get(name);
con.setRequestProperty(name, value);
</HttpMssage>
<Code used to Read the Response.>
                    URL url = new URL(getDocumentBase(),"/ccls/test/delay.jsp");
                    HttpMessage msg = new HttpMessage(url);
                    InputStream in = msg.sendGetMessage(null);
                         char[] buff = new char[2048];
                         int bytesRead;
                         int ch;
                         StringBuffer sbtextbox = new StringBuffer("");
                         DataInputStream data = new DataInputStream(
                                                       new BufferedInputStream(in));
                         String line;
                    while ((line = data.readLine()) != null) {
                              sbtextbox.append(line+"\r\n");
</Code used to Read the Response.>
</CODE>

Go to See the other 5 answers

Http Request through URL Connection?

Category:DefaultRelease time:-0001-11-30Views:130

Hi , Iam using an Applet (under JRE 1.3.0). Iam trying to send a Http Request using URL Connection. It is working fine . However, if the response time of the server is more than 3 minutes , the Response is not coming back to the server and the Applet[More]

Close URL Connection netstat

Category:DefaultRelease time:2015-10-11Views:130

hello all, I hope you can help me. Please have a look at my code below I open an URL Connection but I can't close it. If i type in a DOS Box netstat I see a lot of connection. Now my question is how can I close the connection. m_http.disconnect() see[More]

Map Viewer URL Connection Issue

Category:DefaultRelease time:2015-10-11Views:130

Hi, I have an UI project, for which i have created a Deployment Profile named 'adfXXXXXUI' nothing but created a adflibrary for that UI project. While creating the adf jar, i have come across an Option called 'Connections' . Here i have selected Conn[More]

How to make pool of  url connections in wls?

Category:DefaultRelease time:2015-10-11Views:130

Hi, i have a project in which i have to make a http post to multiple web           servers to retrieve           XML files in response to user requests. Right now i just open the           url for each request.           Is there any way to pool URL[More]

Multiple HTTP requests through same connection

Category:DefaultRelease time:2015-10-11Views:130

Hi... I am writing an application which connect to its server through HTTP protocol and the server is basicaly a bunch of servlets hosted somewhere (Right not it in the tomcat running in my PC) I know that with Connection Keep-Alive header you can ke[More]

Encrypting authentication details - HTTP URL Connection

Category:DefaultRelease time:-0001-11-30Views:130

Hi, We have a Java application which retreives HTML content from intranet page using HTTPURLConnection, displays the portion of the content. The site to which we are connecting using HTTPURLConnection requires baisc user authentication and we are pas[More]

TS2690 we could not complete your itunes store request. the network connection could not be established

Category:DefaultRelease time:2015-10-11Views:130

we could not complete your itunes store request. the network connection could not be establishedHello , you can try to sign out of your apple account then sign in again.Read other 2 answers[More]

My computer failed to install the compatible driver software when updating my iphone and now my iphone is unusable as it is requesting me to connect it to itunes but i physically cannot connect to itunes... help me please?

Category:DefaultRelease time:2015-10-11Views:130

my computer failed to install the compatible driver software when updating my iphone and now my iphone is unusable as it is requesting me to connect it to itunes but i physically cannot connect to itunes... help me please?Hi there croadstar, You may[More]

Error (2931) VMM is unable to complete the request. The connection to the VMM agent on the virtualization server (host.domain.local) was lost.

Category:DefaultRelease time:2015-10-11Views:130

Experts, kindly advice for this error when create vm from a templates, while i'm not having this issue when create the vm to another host from the same templates, firewall is disabled and no antivirus on the host. The network and the ping is very sta[More]

How to restore the appearance of this message? "Requested an encrypted connection to a page [...] Probability of read data [...] [Optional] Always warn me before [...]" Is disabled by default and now I have it shut off permanently.

Category:DefaultRelease time:2015-10-11Views:130

Hello! I have a problem, because when the message appeared: (original) "Zabezpieczenia Zażądano połączenia szyfrowanego ze stroną, która zawiera elementy niezaszyfrowane. Prawdopodobieństwo odczytania przesyłanych danych przez osoby trzecie jest duże[More]

Warning  6226: Ignoring value requested for first connection attribute 'TempSize'

Category:DefaultRelease time:-0001-11-30Views:130

Hi Was trying to load, here is what I see. Appreciate your help. con1: Command> load cache group g_sdata_awt commit every 1000 rows; 5056: The cache operation fails: error_type=<TimesTen Error>, error_code=<3407>, error_message: [TimesTen]T[More]

Hot
Is there any to turn off my iMac from my iPad or iPhone. Thanks.Google turning on/off Mac remotely iPhone or iPad? You'll find one or two apps that fit the bill. Good Luck!Read other 5 answers [More]
I'm working on a solution where we have NetScaler load balancers distributing radius requests from the NADs to respectvie PSNs. Authentication works and redirect URLs work etc.. The challenge we're having is with EAP-TLS sessions. The user get's a pr [More]
I have a one minute, forty second trailer for my movie that I want to put on our website. I need to export the trailer from my Final Cut Pro timeline and give it to my web guy in a form that can be used for viewers with Windows Media Player. Any idea [More]
Hi, I am implementing unhandle messages catching, but yet when I open IE it alert me with errors. How can I hide those errors, I know that you need to have debugger installed to see it but yet, I don't want my users to experience those errors.What er [More]
I am looking at buying the 5800. However after looking at hunderds of reviews and comments it seems to me that users either love or hate their musicexpress with not much inbetween. Knowing that users will often only vent their anger when things go wr [More]
I made a program which takes data from XML and stores it into columns on a datagrid. However the XML document is a static document which is premade. I have been trying to look everywhere for a way to save the document AFTER someone has edited it, thi [More]
Hi, Is it possible to get a count of the records returned in a ResultSet? Also, is it possible to get the text of a query(PreparedStatement). I am using a PreparedStatement, and want to know what the actual query looks like, with the parameters. i.e. [More]
Upon initial startup my ipad 2 is stuck on the connect to itunes screen. how can i get around this and start using my ipad2 without connecting to itunes.If it hasn't got iOS 5+ pre-installed then you will need to connect it to a computer's iTunes in [More]
Hi: I have a very simple test LS App: 1 Table "Person" with 1 property "Name" One totally standard Editable Grid So no complicated calculations that could timed out... When I hit F5 the screen launches and shows the data, but when I tr [More]
I wish I didn't have to use Adobe products because even to use this forum, it's like jumping through 10 hoops. Simple question: I bought Adobe 11 Standard month to month with an annual commitment on Aug. 27, 2014. How do I get this onto my new laptop [More]