⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sessionrefreshthread.java

📁 ICE3.3.0--聊天程序服务器端demo
💻 JAVA
字号:
// **********************************************************************//// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -