1、客户端环境调用
#include<Ice/Ice.h>
int main(int argc, char* argv[])
{
Ice::CommunicatorPtr ic;
try
{
ic = Ice::initialize(argc, argv);
Ice::ObjectPrx base = ic->stringToProxy("MyProxy:default -p 10000");
if (!base)
{
throw "Can not find proxy";
}
MyProxyPrx proxy = MyProxyPrx::checkCast(base);
if (!proxy)
{
throw "Invalid Proxy";
}
proxy->op();
}
catch(const Ice::Exception& ex)
<
#include<Ice/Ice.h>
int main(int argc, char* argv[])
{
Ice::CommunicatorPtr ic;
try
{
ic = Ice::initialize(argc, argv);
Ice::ObjectPrx base = ic->stringToProxy("MyProxy:default -p 10000");
if (!base)
{
throw "Can not find proxy";
}
MyProxyPrx proxy = MyProxyPrx::checkCast(base);
if (!proxy)
{
throw "Invalid Proxy";
}
proxy->op();
}
catch(const Ice::Exception& ex)
<