" + (s.clientName != null ? s.clientName : "?") + " | ");
+ statsFile.print("" + inactive + " | ");
+ statsFile.print("" + (s.VUID > 0 ? s.VUID : "") + " | ");
+ statsFile.print("" + (s.UID > 0 ? s.UID : "") + " | ");
+ statsFile.print("" + (s.MID > 0 ? s.MID : "") + " | ");
+ statsFile.print("" + (s.allMessages ? "+" : "") + " | ");
+ statsFile.print("" + (s.allReplies ? "+" : "") + " |
");
+ } catch (Exception e) {
+ System.err.println("WSKeepAlive statsFile print: " + e);
+ }
+ }
+
+ if (inactive > 180) {
+ closeBytes.rewind();
+ try {
+ s.sock.write(closeBytes);
+ } catch (Exception e) {
+ } finally {
+ try {
+ s.sock.socket().close();
+ } catch (Exception ex) {
+ }
+ try {
+ s.sock.close();
+ } catch (Exception ex) {
+ }
+ i.remove();
+ }
+ } else if (inactive > 60) {
+ pingBytes.rewind();
+ try {
+ s.sock.write(pingBytes);
+ } catch (Exception e) {
+ System.err.println("WSKeepAlive ping: " + e);
+ try {
+ s.sock.socket().close();
+ } catch (Exception ex) {
+ }
+ try {
+ s.sock.close();
+ } catch (Exception ex) {
+ }
+ i.remove();
+ }
+ }
+ }
+ }
+
+ if (Main.STATSFILE != null) {
+ try {
+ statsFile.write("