<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sleepydisco &#187; url java apache http</title>
	<atom:link href="http://www.sleepydisco.com/tag/url-java-apache-http/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sleepydisco.com</link>
	<description>A blog about technology, music, food and photography.</description>
	<lastBuildDate>Sun, 18 Apr 2010 20:53:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>URL connection timeouts&#8230; not timing out</title>
		<link>http://www.sleepydisco.com/programming/url-connection-timeouts-not-timing-out</link>
		<comments>http://www.sleepydisco.com/programming/url-connection-timeouts-not-timing-out#comments</comments>
		<pubDate>Tue, 14 Apr 2009 21:48:17 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[url java apache http]]></category>

		<guid isPermaLink="false">http://www.sleepydisco.com/?p=198</guid>
		<description><![CDATA[After much fussing about, I&#8217;ve found out that the default UrlConnection object in the core Java libraries doesn&#8217;t correctly obey connect or read timeouts set via the setConnectTimeout() or setReadTimeout() methods. The only way I&#8217;ve managed to get this to work, is to add the following arguments to the JVM.
-Dsun.net.client.defaultConnectTimeout=&#60;CONNECT_TIMEOUT&#62;
-Dsun.net.client.defaultReadTimeout=&#60;READ_TIMEOUT&#62;
In future, I&#8217;d be more inclined [...]]]></description>
			<content:encoded><![CDATA[<p>After much fussing about, I&#8217;ve found out that the default <a title="java.net.URLConnection" href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLConnection.html">UrlConnection</a> object in the core Java libraries doesn&#8217;t correctly obey connect or read timeouts set via the setConnectTimeout() or setReadTimeout() methods. The only way I&#8217;ve managed to get this to work, is to add the following arguments to the JVM.<span id="more-198"></span></p>
<pre>-Dsun.net.client.defaultConnectTimeout=&lt;CONNECT_TIMEOUT&gt;
-Dsun.net.client.defaultReadTimeout=&lt;READ_TIMEOUT&gt;</pre>
<p>In future, I&#8217;d be more inclined to use something like the <a title="Apache HttpCommons Client" href="http://hc.apache.org/httpcomponents-client/index.html">Apache HttpCommons Client</a> which provides a full-featured HTTP client.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sleepydisco.com/programming/url-connection-timeouts-not-timing-out/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
