httpConnection  
Author Message
qwerty





PostPosted: 2005-5-22 2:31:00 Top

java-programmer, httpConnection hi alls!

i'm work in a aplication that needs access very often to the class
httpConnection and it makes but very slow.

if i put the ip into the call to httpConnection:
HTTPConnection connection = new HTTPConnection(10.10.10.10);
httpConnection goes to dns???

and later when i do:
connection.Get(url.getFile());
goes again to dns?

thanks alls
 
qwerty





PostPosted: 2005-5-22 23:03:00 Top

java-programmer >> httpConnection hi alls!

i'm work in a aplication that needs access very often to the class
httpConnection and it makes but very slow.

if i put the ip into the call to httpConnection:
聽HTTPConnection聽connection聽=聽new聽HTTPConnection(10.10.10.10);
httpConnection goes to dns???

and later when i do:
connection.Get(url.getFile());
goes again to dns?

thanks alls
 
Chris Smith





PostPosted: 2005-5-22 23:18:00 Top

java-programmer >> httpConnection qwerty <email***@***.com> wrote:
> i'm work in a aplication that needs access very often to the class
> httpConnection and it makes but very slow.
>
> if i put the ip into the call to httpConnection:
> 聽HTTPConnection聽connection聽=聽new聽HTTPConnection(10.10.10.10);
> httpConnection goes to dns???
>
> and later when i do:
> connection.Get(url.getFile());
> goes again to dns?

Do you mean HttpURLConnection? There is no standard API class called
HTTPConnection, nor is there one called httpConnection as you spelled it
in the subject. But HttpURLConnection is lacking a method called get
(much less one called Get, which would violate Java naming conventions).
Either you are very confused, or you are using some third-party package
that you neglected to tell us about. In either case, next time you
post, please make an effort at some kind of precision with regard to
spelling your classes and methods (including case), basic Java syntax,
etc... This message borders on being completely unreadable.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
 
qwerty





PostPosted: 2005-5-23 0:15:00 Top

java-programmer >> httpConnection Chris Smith wrote:

ok chris, i will try to be more specify. Sorry.

like you said in your post, i used a package : httpclient
http://jakarta.apache.org/commons/httpclient/
. Well,
one class of this package is HTTPCONNECTION that makes a socket
connection foreground.

when i do:
httpConnection connection = new httpConnection("www.google.com")
i think that the socket connection in java uses dns for traslate
the name www.google.com to ip (10.10.10.10)

and my question is: if i do this:
httpConnection connection = new httpConnection(10.10.10.10)
the socket connection goes to dns or not??

 
 
John





PostPosted: 2005-5-24 10:59:00 Top

java-programmer >> httpConnection If you type www.google.com it will go to the DNS, otherwise not.
The communication on the Internet is always done using the IP, so the
only reason
to query a dns server is to translate the name of the server you are
calling to its IP address.
Clearly, going through the dns takes a little longer, especially if you
go to that address often enough
you should see a huge difference in speed between using name or IP.
The other reason you would go to a DNS server is the case when you want
to make a reverse DNS lookup.
That one takes longer than the usual name -> ip query.



qwerty wrote:
> Chris Smith wrote:
>
> ok chris, i will try to be more specify. Sorry.
>
> like you said in your post, i used a package : httpclient
> http://jakarta.apache.org/commons/httpclient/
> . Well,
> one class of this package is HTTPCONNECTION that makes a socket
> connection foreground.
>
> when i do:
> httpConnection connection = new httpConnection("www.google.com")
> i think that the socket connection in java uses dns for traslate
> the name www.google.com to ip (10.10.10.10)
>
> and my question is: if i do this:
> httpConnection connection = new httpConnection(10.10.10.10)
> the socket connection goes to dns or not??
>