If you don't have a name server (DNS server) on your local network, your
network profile lists your ISP's DNS server, and you are not currently
dialed in (presuming this is how you get to the network), then gethostname()
and friends (in Winsock) will *always* be slow.

If the above is your case then your PC is attempting to ask your local name
server to translate your IP address to a name.  If the name server is not
accessible then it will *eventually* time out, and use the name you entered
in your local configuration.

If you run the example when dialed into the internet (and presuming your
network software is correctly configured) then the getRemoteHost() call
should only take a few seconds.

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Bruce
> Bantos
> Sent: Sunday, June 06, 1999 1:37 PM
> To: [EMAIL PROTECTED]
> Subject: Re: getRemoteHost() takes FOREVER
>
>
> the getRemoteHost() is slow in snoop servlet as well. I debugged
> it and the
> getRemoteHost call is definitely the call that is slowing the whole thing
> down.
>
> - Bruce
>
> -----Original Message-----
> From: Ralph Eddy <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Sunday, June 06, 1999 12:37 PM
> Subject: Re: getRemoteHost() takes FOREVER
>
>
> >getRomoteHost() is in SnoopServlet.
> >I ran it on the same setup as you and it is instant.
> >Try SnoopServlet and see if it takes as long.
> >
> >Ralph Eddy
> >415-383-4924
> >fax) 415-383-6560
> >mailto:[EMAIL PROTECTED]
> >
> >
> >> -----Original Message-----
> >> From: A mailing list for discussion about Sun Microsystem's
> >> Java Servlet
> >> API Technology. [mailto:[EMAIL PROTECTED]]On
> >> Behalf Of Bruce
> >> Bantos
> >> Sent: Sunday, June 06, 1999 7:50 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: getRemoteHost() takes FOREVER
> >>
> >>
> >> I think this must be a network names resolution problem rather than a
> >> servlet problem, but I thought I would see if anyone else has
> >> ran into it:
> >>
> >> When I call getRomoteHost(), it takes about 2 minutes for my servlet's
> >> doPost to be processed once I hit the submit button. If I
> >> comment out the
> >> getRemoteHost line, it takes a second. The results are
> >> correct once the
> >> thing finishes. I am running IIS 4.0, Jrun, and IE5.0 all on the same
> >> machine. The result of getRemoteHost is a string containing
> >> "DEVELP", which
> >> is the NT name of my machine.
> >>
> >> Does anyone know of a way to speed this up, perhaps a setting
> >> in NT? Thanks.
> >>
> >> -Bruce
> >>
> >> ______________________________________________________________
> >> _____________
> >> To unsubscribe, send email to [EMAIL PROTECTED] and
> >> include in the body
> >> of the message "signoff SERVLET-INTEREST".
> >>
> >> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >> Resources:
> >> http://java.sun.com/products/servlet/external-> resources.html
> >>
> >> LISTSERV Help:
> >> http://www.lsoft.com/manuals/user/user.html
> >>
> >
> >_________________________________________________________________
> __________
> >To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> >of the message "signoff SERVLET-INTEREST".
> >
> >Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >Resources: http://java.sun.com/products/servlet/external-resources.html
> >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to