三 ICE开发初级研究
#include "Ice/Ice.h"

#include <string>
using namespace std;
using namespace Test;
class CTest : public TestICE
{
public:
int ping(const Ice::Current&);
int GetTime(string& strTime, const Ice::Current&);
};


{
public:
virtual int run(int, char*[]);
};
int CMainServer::run(int argc, char* argv[])
{
try
{
Ice::ObjectAdapterPtr AdaptrPtr = communicator()->createObjectAdapter("SampleTest");
Ice::ObjectPtr Object = new CTest;
AdaptrPtr->add(Object, communicator()->stringToIdentity("SampleTest"));
AdaptrPtr->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
}
catch(const Ice::Exception ex)
{
printf("[Main]Error = %s.\n", ex);
return -1;
}
}
int main(int argc, char* argv[])
{
CMainServer app;
app.main(argc, argv, "init.config");
getchar();
return 0;
}




{
public:
virtual int run(int, char*[]);
};
int CMainClient::run(int argc, char* argv[])
{
try
{
string strData = "I'm a freeeyes.";
TestICEPrx testice = TestICEPrx::checkedCast(communicator()->propertyToProxy("SampleTest.Proxy")->ice_twoway()->ice_timeout(-1)->ice_secure(false));
if(!testice)
{
printf("[CMainClient::run]testice is error.\n");
return EXIT_FAILURE;
}
int nData = testice->GetTime(strData);
printf("[CMainClient::run]GetTime is %d.\n", nData);
return EXIT_SUCCESS;
}
catch(const Ice::Exception ex)
{
printf("[Main]Error = %s.\n", ex.what());
return -1;
}
}
int main(int argc, char* argv[])
{
CMainClient app;
app.main(argc, argv, "init.config");
getchar();
return 0;
}

三 ICE开发初级研究的更多相关文章
- iOS企业级开发初级课程-表视图(13集)
首先了解了表视图的组成.表视图类的构成.表视图的分类以及表视图的两个重要协议(委托协议和数据源协议),对表视图有了一个整体上的认识.接下来我们掌握了如何实现简单表视图和分节表视图,以及表视图中索引.搜 ...
- 20145213《Java程序设计》实验三敏捷开发与XP实践
20145213<Java程序设计>实验三敏捷开发与XP实践 实验要求 1.XP基础 2.XP核心实践 3.相关工具 实验内容 1.敏捷开发与XP 软件工程是把系统的.有序的.可量化的方法 ...
- 20162311 实验三 敏捷开发与XP实践 实验报告
20162311 实验三 敏捷开发与XP实践 实验报告 实验内容 一.研究学习IDEA中的Code菜单 使用Code ->Reformate Code功能将以下代码格式化 public clas ...
- APP的三种开发模式
转载于http://pleasureswx123.github.io/2014/09/15/APP%E7%9A%84%E4%B8%89%E7%A7%8D%E5%BC%80%E5%8F%91%E6%A8 ...
- #实验三 敏捷开发与XP实践---实验报告
一.实验三 敏捷开发与XP实践-1 1.实验要求 -实验三 敏捷开发与XP实践 http://www.cnblogs.com/rocedu/p/4795776.html, Eclipse的内容替换成I ...
- 20165223 实验三 敏捷开发与XP实践
目录 一.实验报告封面 二.具体实验内容 (一)敏捷开发与XP实践-1 代码规范格式化 (二)敏捷开发与XP实践-2 添加搭档项目 (三)敏捷开发与XP实践-3 搭档代码重构 (四)敏捷开发与XP实践 ...
- 20165337实验三——敏捷开发与XP实践
实验要求 实验三-1 敏捷开发与XP实践 http://www.cnblogs.com/rocedu/p/4795776.html, Eclipse的内容替换成IDEA 参考 http://www.c ...
- 20165323 实验三 敏捷开发与XP实践
一.实验报告封面 课程:Java程序设计 班级:1653班 姓名:杨金川 学号:20165323 指导教师:娄嘉鹏 实验日期:2018年4月28日 实验时间:13:45 - 15:25 实验序号:实验 ...
- 20165220 实验三 敏捷开发与XP实践 实验报告
实验三 敏捷开发与XP实践-1 实验要求: 实验三 敏捷开发与XP实践 http://www.cnblogs.com/rocedu/p/4795776.html, Eclipse的内容替换成IDEA ...
随机推荐
- UDP数据接收服务器
简介 这是我在做一个要用UDP方式进行数据传输时,自己写的一个多线程的UDP数据接收服务器, 它能将接收到的UDP数据包存成文件,并提供数据包接收时间监测: 还支持键盘命令响应,以将数据写到新的文件, ...
- WPF Image触摸移动方法
1: TouchPoint mPoint = null; 2: double mOffsetX;//水平滚动条当前位置 3: double mOffsetY;//垂直滚动条当前位置 4: bool m ...
- sql server 2008 在与 SQL Server 提示建立连接时出现与网络相关的或特定于实例的错误
原文地址:http://zhidao.baidu.com/link?url=Ndav32DO9zL5XnltqoqlhvKHbJv_n3Zwihhw4cwF9ffNq8hb8z7h7n3vJVfoeW ...
- 方案:手动升级WordPress系统
对于WordPress系统及时进行更新维护是十分必须的操作,更新维护不仅可以更新系统服务功能,还能够完善安全系统. 如果你是虚拟主机的用户,可以使用FTP账户进行自动更新服务,但是如果你是V ...
- ./scripts/feeds update -a OpenWrt大招系列
./scripts/feeds update -a Updating feed 'packages' from 'https://github.com/openwrt/packages.git' .. ...
- (转载) C/C++编译和链接过程详解 (重定向表,导出符号表,未解决符号表)
转载http://blog.csdn.net/neo_ustc/article/details/9024839 有 些人写C/C++(以下假定为C++)程序,对unresolved external ...
- Python多进程(multiprocessing)
Unix/Linux操作系统提供了一个fork()系统调用,它非常特殊.普通的函数调用,调用一次,返回一次,但是fork()调用一次,返回两次,因为操作系统自动把当前进程(称为父进程)复制了一份(称为 ...
- 苹果拒绝App内部使用版本检测功能
10.6 - Apple and our customers place a high value on simple, refined, creative, well thought through ...
- Mysql日期函数,时间函数使用的总结
一.MySQL 获得当前日期时间 函数 1.1 获得当前日期+时间(date + time)函数:now() mysql> select now();+--------------------- ...
- CLR via C# - 基础拾遗
编译器开关设置 IL代码质量 JIT本地代码质量 /optimize- /debug-(默认设置) 未优化 优化 /optimize- /debug+(full/pdbonly) 未优化 未优化 /o ...