📄 session.cs
字号:
// **********************************************************************
//
// 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.
//
// **********************************************************************
using System;
using System.Threading;
namespace ChatDemoGUI
{
public class Session
{
//
//
// This class is responsible for keeping the session open and controlling its life time.
//
public Session(Chat.ChatSessionPrx session, long period)
{
this._session = session;
this._sessionRefreshThread = new SessionRefreshThread(_session, period);
this._thread = new Thread(new ThreadStart(this._sessionRefreshThread.run));
this._thread.Start();
}
public Chat.ChatSessionPrx proxy()
{
return _session;
}
public void close()
{
_sessionRefreshThread.done();
for(;;)
{
try
{
_thread.Join();
break;
}
catch (ThreadStateException)
{
}
catch (ThreadInterruptedException)
{
}
}
try
{
_session.destroy();
}
catch(Ice.LocalException)
{
}
}
private Chat.ChatSessionPrx _session;
private SessionRefreshThread _sessionRefreshThread;
private Thread _thread;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -