At 10:25 AM 2/24/99 -0800, you wrote:
>"Marc A. Saegesser" wrote:
>> 
>> There is a known problem in Apache on Win32 platforms which causes the
>> output of CGIs and servlets to be buffered.  
>
>Is this a problem? Isn't this done so the server can send the content length 
>back to the browser before actually sending the content? My experience with 
>the 
>JavaWebServer on NT is that I had a problem with clogged routers back to the 
>client if I did not set the content length before sending the output back to 
>the
>
>client. 
>
>Since the JWS buffer is only 4KB I often had to fill my own buffer, send the 
>content length and then write the buffer back. If I didn't do this the client 
>browser sometimes thought my servlet was done and closed the connection 
>premeturely.

The problem is that 4KB buffers are HUGE for some applications.  I've got a
servlet which needs to run for as long as there is a connection.  It
monitors events in the real world and sends data back to the client as
certain things happen.  The data sent back to the client general comes in
100-500 byte clumps and may arrive in a trickle.  It could take a very long
time to fill a 4KB buffer before Apache will send the data to the browser.
This is fatal for a monitor application.

Apache 1.3.* handles this by buffering data from the CGI or servlet and
flushing the buffer when ever it fills *or whenever it would block waiting
for data from the CGI or servlet*.  This is a pretty good middle ground
solution.  If the servlet is slowly generating data the client still gets
the data fairly quickly.  If the servlet is generating data really fast
then the buffering will avoid lots small network transacations.

Unfortunately, the highlighted text above simply doesn't work on Win32.
There isn't any way to do the non-blocking I/O.  I thought there was, but
after spending a fair amount of time looking into it, I'm convinced it just
isn't possible.  Apache is based too heavily on UNIX style I/O and the
Win32 I/O subsystem to too different and limited.

There may be problems making CGI and servlet output unbuffered, that's why
I posted.  If unbuffered CGI and servlets won't work then the only choice I
have left is to switch to a different web server for the Win32 platform.

Marc Saegesser
--
The world has arrived at an age of cheap complex devices of great
reliability; and something is bound to come of it.
   Vannevar Bush, 1945



----------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://www.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to