[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now



Posted on 2001-08-26
Medium Priority
Last Modified: 2012-05-04
I am using urlconnection class for getting realtime quotes for my Stocks Web Application. I set keep-alive connectin, the back-end will keep sending realtime quotes to application. But i am getting problems in different kinda browsers. Internet Explorer not able to referesh the screen according to my request. Netscape 4.7 is refreshing but not perfectly. Netscape 6.1 which is using Java plug-in, is seems to ok.  

Earlier when i was using sockets i dont get any problem. With same peach of code, just changing after to URLConnection it start giving problems...

Can anyone guide me in this regard. Is it problem with protocol or url connection or my browser...What could be the problem.
Question by:vinaykn
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
LVL 16

Expert Comment

ID: 6428781
> not able to referesh the screen according to my request.

I suppose that you are receiveing the same data upon each request, because somebody (JavaVM / browser / proxy) caches the answer.

I would suggest you to use unique URL for each request (appending random number for example)

Author Comment

ID: 6430441
I am not able open the url sent by you. Is it correctly typed? can you check for me?

Thanking you..

Author Comment

ID: 6430757
Whenever i am pressing a button to refresh(or to sort the stocks) i will send a message to back-end. Back-end will send a message, basing on that message my application will refresh and sort the data which is stored in a vector.

Now the problem is, when i am Netscape, its sending message to back-end and also getting response from back-end, basing on that its doing refreshing or sorting perfectly.

When i am using Netscape, its sending message to back-end. Back-end also responding immediately sending data.  But, my browser not able to read it immediately....If i press continuiously three or four times, its reading all three or four messages from back-end and then doing processing?

Is it any problem with browser stream handling, howcan i read immediately whenever a back-end send something....Is it reading problem or any cache problem...

Can you help me in this way....

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 16

Expert Comment

ID: 6430915
> I am not able open the url sent by you. Is it correctly typed?

it's just a sample URL that uses random suffix

> its reading all three or four messages from back-end and then doing processing?
> Is it reading problem or any cache problem...

I don't know what your backend is doing. the ONLY POSSIBLE difference between socket based and http based protocols is caching that may be done transparently from some proxy.

add some additional System.out.println()s to track the problem.
check if backend receives the messages.
check when exactly client receives the answer and what's that answer.

Author Comment

ID: 6431107

While using sockets i used BufferedReader to read input from back-end.  It didnt give any problems while reading data from back-end and processing and refreshing.

When i encounter about problem, that too only, in Internet explorer, i changed it to DataInputStream.  Now its working fine in both browsers...

Why this BufferedReader gave me problems when i changed my socket connection to URLconnection.

Thanks again..

LVL 16

Accepted Solution

heyhey_ earned 200 total points
ID: 6431132
I do not have your code, so I cannot give you perfect answer, but generally speaking 1. BufferedReader works with Unicode chars (2+ byte sequences) / not bytes and 2. BufferedReader 'sometimes buffers' the incoming data :)

best solution is to read the data directly from the InputStream.

Author Comment

ID: 6431178
why only 'sometimes'? can you give me any idea this. I think this buffering only gives me problems...
LVL 16

Expert Comment

ID: 6431185
post some sample code that reproduces the problem

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question