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

📄 client.cpp

📁 ICE-3.2 一个开源的中间件
💻 CPP
字号:
// **********************************************************************//// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.//// This copy of Ice is licensed to you under the terms described in the// ICE_LICENSE file included in this distribution.//// **********************************************************************#include <TestCommon.h>#include <IceUtil/CtrlCHandler.h>#include <IceUtil/Thread.h>#include <IceUtil/Time.h>using namespace IceUtil;using namespace std;void callback(int signal){    cout << "Handling signal " << signal << endl;}int main(){    {        cout << "First ignore CTRL+C and the like for 10 seconds (try it!)" << endl;        CtrlCHandler handler;        ThreadControl::sleep(Time::seconds(10));                cout << "Then handling them for another 30 seconds (try it)" << endl;        handler.setCallback(callback);        ThreadControl::sleep(Time::seconds(10));                     }    cout << "And another 10 seconds after ~CtrlCHandler" << endl;    ThreadControl::sleep(Time::seconds(10));    cout << "ok" << endl;    return EXIT_SUCCESS;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -