Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Can I use Same TCP connection(for HTTP) to get the response fromserver

Thread view: 
Matrixinline - 22 Jun 2007 13:48 GMT
Hi,

I am writing a browser application.

I just wnat to know is their any way to use the same HttpURLConnection
to be re use to fetch the data from another URL.

I know it is a silly question as Http is a Stateless application but I
am querious to know more about Keep - Alive persitance connection at
server end. as we know that Server can keep connection open if keep
alive is mentioned in the header.

Thanks
Anup
Lothar Kimmeringer - 22 Jun 2007 14:52 GMT
> I just wnat to know is their any way to use the same HttpURLConnection
> to be re use to fetch the data from another URL.

No but HttpUrlConnection is using the same connection if
"keep-alive" is supported. But to you, this kind of
functionality is hidden and happens "automagically".

Regards, Lothar
Signature

Lothar Kimmeringer                E-Mail: spamfang@kimmeringer.de
              PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                questions!

bencoe@gmail.com - 22 Jun 2007 22:50 GMT
On Jun 22, 9:52 am, Lothar Kimmeringer <news200...@kimmeringer.de>
wrote:
> > I just wnat to know is their any way to use the same HttpURLConnection
> > to be re use to fetch the data from another URL.
[quoted text clipped - 10 lines]
> Always remember: The answer is forty-two, there can only be wrong
>                  questions!

Are you hoping to get stuff rendering eventually for this web-browser
you're working on, you might try playing with an existing library:

may I suggest this...

http://html.xamjwg.org/cobra.jsp

It supports style sheets and other neat things, it also has a few
memory leaks I found when I was working with the library, I should
probably tell them about these ;)

But if you're really interested in how HTTP connections and parsing
HTML documents can be done, I recommend this as a starting point... It
uses a DOM (document object model), which you will certainly want to
learn - It' used by parsing libraries like Xerces.

-----
Ben.
http://www.plink-search.com
Lothar Kimmeringer - 23 Jun 2007 13:58 GMT
> Are you hoping to get stuff rendering eventually for this web-browser
> you're working on, you might try playing with an existing library:

I'm not trying to render anything. I even haven't asked a
question in this thread.

Regards, Lothar
Signature

Lothar Kimmeringer                E-Mail: spamfang@kimmeringer.de
              PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                questions!

Lew - 23 Jun 2007 14:02 GMT
>> Are you hoping to get stuff rendering eventually for this web-browser
>> you're working on, you might try playing with an existing library:
>
> I'm not trying to render anything. I even haven't asked a
> question in this thread.

I don't know, this is just a WAG, but perhaps bencoe's comment was intended
for the OP with respect to the primary topic of the thread, which of course,
you did not initiate and thus probably were not the antecedent.

Signature

Lew

bencoe@gmail.com - 23 Jun 2007 17:01 GMT
> > ben...@gmail.com wrote:
>
[quoted text clipped - 10 lines]
> --
> Lew

Sorry Lothar, that was meant as a reply to the original message, as
Lew suggests.

Ben.
Matrixinline - 25 Jun 2007 11:58 GMT
On Jun 23, 9:01 am, ben...@gmail.com wrote:

> > > ben...@gmail.com wrote:
>
[quoted text clipped - 15 lines]
>
> Ben.

One more Please

When I say HttpURLConnection.close() does it close the TCP Connection
even if Keep Alive is true?
Lothar Kimmeringer - 26 Jun 2007 23:01 GMT
> When I say HttpURLConnection.close() does it close the TCP Connection
> even if Keep Alive is true?

There is no close()-method but if you mean disconnect(), just
read the Javadoc:

http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html#disconnect()

| Indicates that other requests to the server are unlikely in the
| near future. Calling disconnect() should not imply that this
| HttpURLConnection instance can be reused for other requests.

So it's a definitely "maybe, it depends on the concrete
implementation and should only be seen as suggestion to it
when used".

Regards, Lothar
Signature

Lothar Kimmeringer                E-Mail: spamfang@kimmeringer.de
              PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                questions!



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.