sessionrefreshthread.java
来自「ICE3.3.0--聊天程序服务器端demo」· Java 代码 · 共 67 行
JAVA
67 行
// **********************************************************************//// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.//// This copy of Chat Demo is licensed to you under the terms// described in the CHAT_DEMO_LICENSE file included in this// distribution.//// **********************************************************************package ChatDemoGUI;import javax.swing.SwingUtilities;class SessionRefreshThread extends Thread{ SessionRefreshThread(Coordinator coordinator, Chat.ChatSessionPrx session, long period) { _coordinator = coordinator; _session = session; _period = period; _done = false; } public synchronized void run() { do { try { _session.ice_ping(); try { if(!_done) { wait(_period); } } catch(InterruptedException ex) { } } catch(Ice.LocalException e) { _done = true; _coordinator.setError("<system-message> - The connection with the server was unexpectedly lost.\n" + ChatUtils.stack2string(e) + "\nYou can try to login again from the File menu."); } } while(!_done); } public synchronized void done() { if(!_done) { _done = true; notify(); } } private final Coordinator _coordinator; private final Chat.ChatSessionPrx _session; private final long _period; private boolean _done = false;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?