RVASUDEV wrote:
> Hi,
>
> [Versions:
> For servlet: Java 1.1.6/JSDK 2.1 on HP-UX 10.20,
> For browser: Netscape Communicator 4.7 on Win NT 4.0 SP3
> ]
> On running a servlet that invokes a UNIX command via the Runtime/Process
> classes, in some cases, it works fine. In others, the browser (Netscape 4.7)
> gives the message "Connect : host <IP address> contacted. Waiting for reply
> ..."
This would happen if you had some sort of endless loop in your servlet (or the
program that it called), and it never returned. Put debugging statements into
your servlet to figure out what's going on.
>
> (I'm using the IP address of my UNIX box instead of a hostname in the URL
> for the servlet that I type in the browser).
> When I do a "netstat -a | grep 8080" (the jsdk2.1 servlet runner uses port
> 8080),
> I get the following output :
>
> atlas:/appl/jsdk2.1 ->netstat -a | grep 8080
> tcp 0 0 tintin.8080 206.236.140.65.2640
> CLOSE_WAIT
> tcp 0 0 tintin.8080 206.236.140.65.2639
> CLOSE_WAIT
> tcp 0 0 tintin.8080 206.236.140.65.2637
> CLOSE_WAIT
> tcp 0 0 tintin.8080 206.236.140.65.2636
> CLOSE_WAIT
> tcp 0 0 tintin.8080 206.236.140.65.2635
> CLOSE_WAIT
> tcp 0 0 *.8080 *.* LISTEN
>
> Can anyone tell me what this output means, particularlt the CLOSE_WAIT ?
>
This is normal and to be expected.
Each request to your servlet occurs on a separate TCP socket connection from
your client (IP address 206.236.140.65 in this case) to the server. Once the
servlet creates the response and sends it back, the socket connection is closed
at both ends.
When a TCP connection is closed, there is a timeout at the server end to make
sure all the bytes have been sent. This shows up as CLOSE_WAIT in a "netstat"
report. They eventually go away, after the timeout period has elapsed.
The LISTEN state means that your servlet runner is still listening for
subsequent requests.
> Vasudev
>
Craig McClanahan
___________________________________________________________________________
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