Menu

setting timeout for http

Help
4r1y4n
2011-12-19
2012-09-04
  • 4r1y4n

    4r1y4n - 2011-12-19

    Hi

    I'm using the code below to define timeout for http but while I'm setting it
    to 20000 it takes about 40-50 seconds until timeout get reached! and when I
    set it to 30000 timeout never reaches (At least in 2 minutes that I waited)!!

        <var-def name="WTimeOut">20000</var-def>
    
        <script  language="javascript"> 
            var tmot=WTimeOut.toString();
                http.client.params.soTimeout = tmot;
            http.client.params.connectionManagerTimeout = tmot; 
            http.client.httpConnectionManager.params.connectionTimeout = tmot; 
        </script>
    

    what is the problem?

    thanks

     
  • Anonymous

    Anonymous - 2012-01-04

    try this

    <template>var tmot= ${WTimeOut.toString()};</template>
    
     
  • Steven P. Goldsmith

    Or in 2.1 trunk code:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <!-- 
    Common variables and functions 
    -->
    
    <config xmlns="[url]http://web-harvest.sourceforge.net/schema/2.1/core[/url]" charset="UTF-8">
    
        <script>
            <![CDATA[
                // HTTP client defaults
                http.client.params.soTimeout = 5000;
                http.client.params.connectionManagerTimeout = 5000;
                http.client.httpConnectionManager.params.connectionTimeout = 5000;
            ]]>
        </script>
    
    </config>
    
     

Log in to post a comment.