三 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 ...
随机推荐
- python 程序穩定性閒談-續集
前文再續,書接上一回.上次總結python錯誤碼返回與異常機制共用的一些原則,毫無疑問地,仍會出現程序不穩定的現象(好吧,可能是我個人能力問題).在公司做的一個項目中,出現了因爲使用外部模塊造成pyt ...
- Lucene.net常见功能实现知识汇总
在开发SearchEasy Site SearchEngine(搜易站内搜索引擎)的时候,经常会遇到一些搜索引擎的常见功能如何实现的问题,比如实现相关度百分比显示?如何实现在结果中搜索等等诸如此类常见 ...
- 漏洞:WebRTC 泄漏用户IP
WebRTC又称为“网页即时通信”,是一组API函数,它经过W3C组织的认证,支持浏览器之间的语音通话.视频聊天和P2P模式分享文件. 这个协议主要包括:getUserMedia,RTCPe ...
- Sliding Window Maximum 解答
Question Given an array of n integer with duplicate number, and a moving window(size k), move the wi ...
- PHP商城购物车类
<?php /* 购物车类 */ // session_start(); class Cart { //定义一个数组来保存购物车商品 private $iteams; private stati ...
- R6010 -abort() has been called错误分析及其解决方法
近期使用vs2010编程出现下面问题.在网上收集了大家的意见之后,整理了一下 导致出现这种原因有: 1.非法指针訪问和内存泄漏 2.大家再查查吧.一定是指针出现故障了.设置的指针范围跟你执行的不正确 ...
- Js 实现 C# Format方法
参考网友的, 挺好用的: String.prototype.format = function (args) { if (arguments.length > 0) { var result = ...
- asp.net 页面实践执行顺序
protected void Page_Load(object sender, EventArgs e) { } #region OnPreInit 第一步 protected override vo ...
- border-radius实例1
简单参数设置一 1.html <div class="paddingBig"> <div class="divSmall radiusOne" ...
- SQL server sysobjects表说明
sysobjects 表 在数据库内创建的每个对象(约束.默认值.日志.规则.存储过程等)在表中占一行.只有在 tempdb 内,每个临时对象才在该表中占一行. sysobjects 表结构: 列名 ...