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
Hi I have just downloaded the SMS timer application from symbian freak website and installed it on my phone 5800XM (v40). However, the application is not working. When I am sending a SMS, it does not ask me to schedule it. The SMS gets sent immediate [More]
I wish to know how to solve this error. It's not that I can not use iTunes, because I can, but once I say OK to the error and start to use iTunes, a message keeps popping up every few seconds or minutes saying that iTunes is trying to connect itself [More]
When I email videos or photos they are sometimes received upside down.help.You need to clarify your statement/question a little bit more. What device are using to take the photo? I assume that you are using your iPad, but I don't know that for a fact [More]
Hello Everybody, I'm having serious Problems with accessing a WebService (Tomcat-Axis) per executable jar-File. I constructed a simple GUI with 3 Textboxes 1 Button and 1 Resultbox. I use eclipse so it was no Problem to simple generate the Background [More]
BT PROBLEMS COMPLAINT NO VOL012-*********** I am in the throes of a number of problems concerning my ‘contracts’ with BT I shall try to be brief and to the point but there are numerous problems, all of BTs making. On Saturday August 19 at approx. 9am [More]
I had noticed many times that my lumia's volume was not working even though I minimized volume.have you checked that your back cover is sealed on the phone correctly, and also tried performing a soft reset? also check that you are up to date with the [More]
In iMovie 08, I have two inputs, iSight camera (old stand alone model) and a fw analog to digital input. I record, and I hear sound on play back, but not when I am recording. How Can I turn on the monitor sound? BTW, sound is not muted in the Project [More]
Hi all, I have the following code to output data. OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE encoding default. my question is what the format of output file should be? Is there any specific requirement? And if I run this code successfully, I shoul [More]
Dear support, the welcome word whitin the Mast Head is wrong translated in Italian. For example "Welcome, Mario Rossi" is translated in "Benvenuti Mario Rossi" instead of "Benvenuto Mario Rossi", because Mario is a masculine [More]
Hi There, I have the G5 2.3 Ghz (2 cores) with the GeForce 6600 card, My question is: will it work with a new Samsung 24" 1920x1200 (model: 2493HM) with a DVI-D port out of the box? or do I need an adaptor to connect them. a friend led me to believe [More]