<div>I use the memcached's java client 1.5 version(compile by JDK1.5). But I encounter a problem:</div>
<div>When the memcached'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> </div>
<div>This is my code:</div>
<div> try {<br> <br> SockIOPool pool = SockIOPool.getInstance();<br> pool.setServers(new String[]{"localhost:11211"});<br> pool.setFailover(true);<br> pool.initialize();<br> MemCachedClient mc = new MemCachedClient();
<br> <br> while(true){<br> Thread.sleep(1000);<br> mc.set("abc", "abc");<br> System.out.println("Set");<br> String s = (String)mc.get("abc");<br> System.out.println
("cached:"+s);<br> break;<br> }<br> } catch (Throwable e) {<br> e.printStackTrace();<br> return;<br> }</div>