----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Apache/1.3.12 (win32)
ApacheJServ/1.1.1
WinNT 4.0
JDK1.3
Netscape Navigator 4.7
I'm trying to do server push here, I've change the jserv_ajpv11.c
ajpv11_handler() to make server push works. The following source work
find. But the servlet wouldn't stop until it goes 1000 times, even if the
client already dies. E.g. browser stop or even closed.
I read somewhere, it says out.println should throws IOException if the
client connection has closed. What could be wrong, any guess? Thanks in
advance.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class TestPush1 extends HttpServlet
{
public void service (HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException
{
response.setContentType("multipart/x-mixed-replace;boundary=boundary");
PrintWriter out = response.getWriter();
out.println();
out.println("--boundary");
out.flush();
for(int i=1;i<=1000;i++)
{
out.println("Content-Type: text/html");
out.println();
out.println("<html>");
out.println("<body>");
out.println("<h1>"+i);
out.println("</body>");
out.println("</html>");
out.println("--boundary");
out.flush();
}
}
}
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]