@@ -0,0 +1,705 @@
+package com.lance.websocket.config;%0A%0Aimport java.io.IOException;%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0Aimport java.util.Iterator;%0A%0Aimport org.apache.commons.lang3.time.DateUtils;%0A%0Apublic class SockTaskRunner implements Runnable%7B%0A%09public void run() %7B%0A%09%09Iterator%3CSocketSessionInfo%3E it = SocketSessionHandler.sessions.iterator();%0A%09%09while(it.hasNext()) %7B%0A%09%09%09SocketSessionInfo info = it.next();%0A%09%09%09%0A%09%09%09if(DateUtils.truncatedCompareTo(new Date(), info.getEndSessionTime(), Calendar.MINUTE) %3E 0) %7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09info.getWebSocketSession().close();%0A%09%09%09%09%09SocketSessionHandler.newInstance().removeSession(info.getSessionId());%0A%09%09%09%09%7D catch (IOException e) %7B%0A%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D

add socket taskrunner