<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>a.muse: Tag test</title>
    <link>http://www.jessirae.com/blog/articles/tag/test</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>One Useful Infinite Loop</title>
      <description>&lt;p&gt;If you are ever are in need of a page that would keep a url connection open for an extended period of time, as opposed to simply returned a 404 or 500 error, then you might consider simulating an unresponsive page by creating a page with an infinite loop on it.&lt;/p&gt;


&lt;code&gt;
&lt;pre&gt;
&amp;lt;html&amp;gt;
&amp;lt;script&amp;gt;
   function infiniteLoop() {
   var i = 0;

   while (i&amp;lt;=0)
   {
     i = i-1;
   }
}
&amp;lt;/script&amp;gt;
&amp;lt;body onload="infiniteLoop()"&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;Ok, so javascript won&amp;#8217;t work (that is, you should get a 200 from this page) because it is on the client side, but do the same thing with a jsp or embedded ruby.&lt;/p&gt;


&lt;code&gt;
&lt;pre&gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;% int i = 0;
while (i&amp;lt;=0) {
  i--;
}
%&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;This is nice for testing timeout parameters on an http connection that you have opened up.  For instance, using the java library &lt;a href="http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/HttpClient.html"&gt;HttpClient&lt;/a&gt;, you can set the connection timeout on a connection.  Instead of attempting to connect with the availabe resource, try to connection to this infinite loop page.&lt;/p&gt;
</description>
      <pubDate>Mon, 28 Jan 2008 20:49:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:59f66ffe-aff2-4a6a-ae49-035561e426a5</guid>
      <author>Jessica</author>
      <link>http://www.jessirae.com/blog/articles/2008/01/28/one-useful-infinite-loop</link>
      <category>technology</category>
      <category>test</category>
      <category>timeout</category>
      <category>connection</category>
      <category>http</category>
      <category>httpclient</category>
      <category>java</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/12734</trackback:ping>
    </item>
  </channel>
</rss>
