三 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 ...
随机推荐
- 使用WCF实现SOA面向服务编程—— 架构设计
原文地址:http://www.cnblogs.com/leslies2/archive/2011/03/29/1997889.html SOA本身就是一种面向企业级服务的系统架构,简单来说,SOA就 ...
- Hdu3436-Queue-jumpers(伸展树)
Description Ponyo and Garfield are waiting outside the box-office for their favorite movie. Because ...
- HDU1394 Minimum Inversion Number(线段树OR归并排序)
Minimum Inversion Number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java ...
- HDU 1576 A/B(数论)
题目:求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1).数据给出n和b 推导过程 A/B = K K = 9973* ...
- Ajax长连接
所谓的长连接,就是不断去发送请求,把请求阻塞在服务器端,每次超过请求时间就去重新发送请求,保持连接,随时获取服务器端的响应的数据 项目案例: function connection(){ ...
- poj1410
简单题,注意是实心矩形 #include <iostream> #include <math.h> #include <iomanip> #define eps 1 ...
- Timer.3 - Binding arguments to a handler
In this tutorial we will modify the program from tutorial Timer.2 so that the timer fires once a sec ...
- [CSAPP笔记][第一章计算机系统漫游]
计算机系统漫游 我们通过追踪hello程序的生命周期来开始对系统的学习—–从它被程序员创建,到系统上运行,输出简单的消息,然后终止.我们沿着这个程序的生命周期,简要介绍一些逐步出现的概念,专业术语和组 ...
- EffectiveC#12,13,14--成员初始化
1.在一个类里声明变量的同时,直接创建实例值.包括静态的和实例的变量 例:object m_o = new object(); 如下情况时不建议这么做:第一种 值类型. int i=new int() ...
- Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I have installed a Web application on IIS 7.0 windows server 2008 R2 64 bit OS I am refering a oracl ...