日期:2014-05-20 浏览次数:20732 次
private void start(final Object socketServer, final Object socketFmPort, final Object rawDataRing) { Thread thread = new Thread(new ZteQZJClientFmSocket(socketServer, socketFmPort, rawDataRing)); thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread t, Throwable e) { System.out.println("重新启动线程..."); start(socketServer, socketFmPort, rawDataRing); // 调用本身 } }); thread.start(); }