You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by pzy peng <pz...@yahoo.com.cn> on 2005/12/26 02:24:30 UTC

About Tomcat Connector

    Hello: 
   I use Tomcat Connector to forward servlet requests from IIs6 to tomcat5, my config like this: 

file workers.properties.minimal 

worker.list=wlb 
worker.wlb.host=localhost 
worker.wlb.port=8009 
worker.wlb.type=ajp13 
worker.wlb.socket_keepalive=1 
worker.wlb.socket_timeout=36000 


file uriworkermap.properties 
/jsp-examples/*=wlb 
/servlets-examples/*=wlb 

It works fine; 

Now I want a persistence connection to servlet,the servlet like this: 

public class connServlet extends HttpServlet 
{ 
bool doconnect=false; 
  private void connect(HttpServletRequest req, HttpServletResponse res)throws IOException, ServletException 
     { 
        try { 
               ...... 
                while (doconnect==true ) 
                { try { Thread.sleep(10000L); } 
                  catch (InterruptedException i) { break; } 
                 }   
              } 
        catch (Exception e)    {   System.out.println( e.toString());  } 
      } 
     
   public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { 
     String actionType =req.getHeader("ActionType"); 
     if (actionType.equalsIgnoreCase("connect") &&  doconnect==false ) 
        {  doconnect=true; connect(req,res);return;   } 
     if (actionType.equalsIgnoreCase("disconnect")  )                 
        {  doconnect=false; return;  } 
    ..... 
       
   } 

} 


It can work in tomcat5,but It can not work with Tomcat Connector in IIs6, 
if Tomcat Connector can not do this or the config file is wrong? 

thanks! 

peng 




__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com