Hello.
I was able to get my Ice project going the standard client and server mechanism where the in the client, the IP address of the server is explicitly declared during initialization or direct binding.
So now, I want to use the IcePack facility ... unfortunately, I'm getting bewildered with the documentation and when I looked into the IcePack Hello demo ... I got more confused.
As a background, what I want to do are two things:
1. Indirect binding with one server adapter and many clients.
2. Indirect binding where on one server, I'll run multiple copies of my Ice server application but with different (but well defined) adapter names. ex. jsockets01, jsockets02, jsockets03, etc. Of course the clients should be able to connect to specific adapters that they need.
NOTE: I dont need IcePack NODES. I manually start the servers.
So what am I confused about? Well, I'll list them:
1.
What to put into the config file?
- I understand the the config file should be passed as parameter to the icepackregistry program but what do I put into it to address my requirements.
2.
How do I change the server so that it would use this facility?
- I currently initialize my server with the following code:
Quote:
Ice::ObjectAdapterPtr adapter =
communicator()->createObjectAdapterWithEndpoints(
"jclCommandAdapter", "default -p 7012 -z");
Ice::ObjectPtr object = new jSocketsI;
adapter->add(object,
Ice::stringToIdentity("jclCommand"));
adapter->activate();
|
The IcePack/Hello demo shows that to initialize the server:
Quote:
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
string id = communicator()->getProperties()->getProperty("Identity");
Ice::ObjectPtr object = new HelloFactoryI();
adapter->add(object, Ice::stringToIdentity(id));
adapter->activate();
|
but checking the CONFIG file that came with the demo, theres no declaration for the adapter called "Hello". In my case, I sort of want to dynamically change the name during startup that I would have 10 servers with adapter names like jsocket01 to jsocket10.
3.
How do I change the client initialization to use the IcePack adapter?
- I initialize the client codes with this:
Quote:
// Create a proxy for the root directory
std::string proxy;
proxy+= "jclCommand:default -h ";
proxy+= hostname;
proxy+= " -p 7012 -z";
Ice::ObjectPrx base = ic->stringToProxy(proxy);
|
unfortunately, I'm having a hard time understanding again the docs and the sample in IcePack/Hello/Client.cpp file is no help.
Can somebody explain what is actually required in a straight forward manner?
Thanks for any help.
Alex
P.S.
I think I need to sleep. Its already 3:15am and I'm tired and grouchy.