title: Setting timeout for wininet in Loadrunner
body: <p>This question for the times when you have to use WinInet replay engine in loadrunner. A timeout error is observed when the response time is more than 30 seconds. By default wininet has timeout set to 30 seconds. There is a way to make it retry the request but in my situation it's a post request and retry is not a realistic case.
  Error encountered is -</p>
  
  <pre><code>Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="https
  </code></pre>
  
  <p><strong>Screenshot of RTS:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/hT9Oi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hT9Oi.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Is there a way to configure the timeout to higher value and where to do it?</strong></p>
  
  <p>LR12.53, Windows server 2008</p>
  
  <h2>New Information</h2>
  
  <p>To demonstrate above behaviour, I have created a web app which takes more than 30 seconds to respond to a GET request. I have also enabled WinInet replay in runtime settings in Loadrunner like shown in above diagram.</p>
  
  <p><strong>Action of the script</strong></p>
  
  <pre><code>Action()
  {
  lr_start_transaction("slow_transaction");
  
  web_custom_request("slow_transaction",
      "URL=http://localhost:8887/slow_response",
      "Method=GET",
      "TargetFrame=",
      "Resource=0",
      "Referer=",
      "Mode=HTML",
      "Body=",
      LAST);
  
  lr_end_transaction("slow_transaction", LR_AUTO);
  
  return 0;
  }
  </code></pre>
  
  <p>On execution of above script with advanced trace, I can see following logs. Error observed is <code>Action.c(6): Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="http://localhost:8887/slow_response"    [MsgId: MERR-27492]</code></p>
  
  <pre><code>Action.c(4): Notify: Transaction "slow_transaction" started.
  Action.c(6): web_custom_request("slow_transaction") started     [MsgId: MMSG-26355]
  Action.c(6): DETECTING_PROXY" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]
  Action.c(6): RESOLVING_NAME" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
  Action.c(6): NAME_RESOLVED" on behalf of "URL="http://localhost:8887/slow_response"     [MsgId: MMSG-27397]
  Action.c(6): CONNECTING_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
  Action.c(6): CONNECTING_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
  Action.c(6): CONNECTED_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]
  Action.c(6): SENDING_REQUEST" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]
  Action.c(6): REQUEST_SENT" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
  Action.c(6): RECEIVING_RESPONSE" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
  Action.c(6): CLOSING_CONNECTION" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
  Action.c(6): CONNECTION_CLOSED" on behalf of "URL="http://localhost:8887/slow_response"     [MsgId: MMSG-27397]
  Action.c(6): REQUEST_COMPLETE" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
  Action.c(6): Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="http://localhost:8887/slow_response"    [MsgId: MERR-27492]
  Action.c(6): HANDLE_CLOSING" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
  Action.c(6): web_custom_request("slow_transaction") highest severity level was "ERROR", 0 body bytes, 0 header bytes    [MsgId: MMSG-26388]
  Action.c(6): Notify: Transaction "slow_transaction" ended with a "Fail" status (Duration: 31.1355 Wasted Time: 0.1075).
  </code></pre>
  
  <p>Now on setting retry with <code>web_set_max_retries("2");</code> in the script, we can clearly see in the logs that it is retrying it after sometime when response doesn't arrive but this will fail too as its a new request and will again take more than 30 seconds ;)</p>
  
  <p><strong>Logs for retry:</strong></p>
  
  <pre><code>Action.c(7): CLOSING_CONNECTION" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
  Action.c(7): CONNECTION_CLOSED" on behalf of "URL="http://localhost:8887/slow_response"     [MsgId: MMSG-27397]
  Action.c(7): REQUEST_COMPLETE" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
  Action.c(7): Attempting "HttpSendRequest" retry due to Windows error code=12002 for URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27491]
  Action.c(7): DETECTING_PROXY" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]
  Action.c(7): CONNECTING_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
  Action.c(7): CONNECTED_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]
  </code></pre>
  
  <p>Now that we have evidence of WinInet retrying after about 30 seconds. Can I please request HP support or other LR experts, WinInet experts to suggest if there is a way to increase the timeout in WinInet and how?</p>