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 experts: In CRM how to work the delivery plant determination? and I can change the Plan in a Sales Order before its download to ECC? I download the DNL_PLANT object but i don't understand what is the functionality of these are created like busines [More]
Hi all, New to the SAP forums...  How do I change the default date range when searching in the forums?  I am getting a 90 day search by default.  Then I have to change it and search again.  Argh! Thanks, --Amy SmithHi Amy, the default date range cann [More]
Hi, I'd be very grateful if anyone can help me with the following problem. I just received my MBP and followed the instructions during setup for transferring all the files from my old iBook G3 to the new laptop via Firewire. This seemed to work fine, [More]
Hi - everything is going along fine with putting songs into my library and updating the Nano. My issue is that I don't want 1000 songs in my hard drive. If I delete some songs out to create space, and update the Nano, will the songs that are missing [More]
I put together a playlist on iTunes, but it shows in reverse order on my iPod. What did I do wrong and how can I fix it? Thanks!Would you be so kind to tell us your smart playlist order. for i have been trying to configure it and still not syncing up [More]
Hi, I downloaded FIFA 14 app using iTunes in my PC. But I'm unable to transfer the .app file onto my iPad! Please help me how to move the app from mypc to ipad?Try signing out of your Apple ID Settings>iTunes & App Store, tap your Apple ID, tap &qu [More]
I am running Mac OS 10.10.1 on a MacBook Pro, I am trying to use AI CS4 ver.14.0.0.0 when I start the program it is open in the back round but will not show up in the command line or display any of the tool pallets.  I can only use force quit.  All t [More]
Hello, I installed EPM v11.1.2.1 but I could not configurate. On EPM configurator step Perform 1st-time configuration of Shared Services database option was disabled. I try to change vpd.properties file's name; but it did not work. Do you give me any [More]
Am running 10.3.9 on a Lacie ext. drive and am trying to upgrade it to 4.6 Tiger. The install disk boots, but after picking Language, it immediately grays over the screen and pops up a window saying "You need to reboot...." and just continues th [More]
conecto mi ipod touch con el cable orinal en la computadora y con un adaptador aparte en la pared y ambas situaciones aparecn un mensaje "este accesorio no permite la  caraga" y aveces al conectyarlo a la computadora me sale un error comopudo so [More]