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
Recently my iPod mini randomly deleted all music/playlists etc. on it. When I connected it to my mac, iTunes told me it had a bug, and that it would automatically download software to fix the bug. I clicked ok, and after the bug had been 'fixed' star [More]
Hi, Client requires a new line item to be created in sale order for particular regions only.. Scenario 1 : For a particular region Additional Tax shud be calculated on Basic Price . Scenario 2 : For a particular region Cess on Vat need to incorporate [More]
We have been trying to find a solution to the speed-change dilemma with GB - I have a 13 mins Cubase project that has 52 speed changes in it. It has been suggested by a Cubase person that we link the composer's Cubase PowerBook to our GB Desktop and [More]
Is it an idea for Apple to create a fingerprint-scanning home button, so the owner can get in without code? And if other people wants in on the iPhone, they need to be added for fingerprint scan, or given the usual 4 number code or the password. I pe [More]
Hi! I get a much higher usage of physical memory when I use shared memory than I would expect. Please, I would really need someone to confirm my conclusions, so that I can revise my ignorance in this subject. In my experiments I create a shared memor [More]
I've been having serious problems with startup since the last security update. Startup hangs at the first gray screen or the while screen with the Apple logo. Sometimes multiple restarts get me to the login screen. Safe mode gets me there as well, bu [More]
Hi All, What is the relation between UTXJ and JMOD!  How JMOD determine in order! ( For TAXINJ). Please help me Regards rajDear Raj Both are not related in anyway.  UTXJ is for sales tax and JMOD is for excise condition.  For UTXJ, you need to create [More]
Could it be possible to retrieve records on behalf of another user in MS CRM 2013/2015 using javascript. Is there any way to use ActOnBehalfOf privilege using javascript? Hi,      This would not be possible from JavaScript due to security reasons I w [More]
Hi, new here so apologies if this subject has been covered. I have just bought a BT6500 set of phones, they sounded just what I needed to stop nuisance calls. The problem is that my CLI doesn't work with this phone.  My CLI works with an old corded h [More]
Curious to know if anyone know of any open source for Cold Fusion that connects to the USPS web tools API and sends an XML request to return city and state based on a valid US zip code number input.Instead of specifying policies for input and output [More]