<div>I use the memcached&#39;s java client 1.5 version(compile by JDK1.5). But I encounter a problem:</div>
<div>When the memcached&#39;s server is closed, the client throw a exception (java.net.ConnectException: Connection refused: connect) and the thread be blocked, the cpu utilization achieve 100% . what should I do ? thanks 
</div>
<div>&nbsp;</div>
<div>This is my code:</div>
<div>&nbsp;&nbsp;try {<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;SockIOPool pool = SockIOPool.getInstance();<br>&nbsp;&nbsp;&nbsp;pool.setServers(new String[]{&quot;localhost:11211&quot;});<br>&nbsp;&nbsp;&nbsp;pool.setFailover(true);<br>&nbsp;&nbsp;&nbsp;pool.initialize();<br>&nbsp;&nbsp;&nbsp;MemCachedClient mc = new MemCachedClient(); 
<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;while(true){<br>&nbsp;&nbsp;&nbsp;&nbsp;Thread.sleep(1000);<br>&nbsp;&nbsp;&nbsp;&nbsp;mc.set(&quot;abc&quot;, &quot;abc&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot;Set&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;String s = (String)mc.get(&quot;abc&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println
 (&quot;cached:&quot;+s);<br>&nbsp;&nbsp;&nbsp;&nbsp;break;<br>&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;} catch (Throwable e) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br>&nbsp;&nbsp;&nbsp;return;<br>&nbsp;&nbsp;}</div>