|
|
|
|||||
|
How to use IceStorm::Service class?
Hi,
i write a simple example which is used to start IceStorm service in C++ code, but i have a problem , and i don't know how to solve it. The Ice Version is 3.2.0. this is the my function below: int main(int argc, char* argv[]){ Ice::ObjectAdapterPtr _topicAdapter; Ice::ObjectAdapterPtr _publishAdapter; IceStorm::ServicePtr ISServer; Ice::Identity ide; ide.name = "TopicManager"; ide.category = "DemoIceStorm"; string name = "IceStorm"; string db = "db"; Ice::CommunicatorPtr ic; Ice::InitializationData initData; initData.properties = Ice::createProperties(); initData.properties->load("config.IceStormServer"); ic = Ice::initialize(initData); _topicAdapter = ic->createObjectAdapter(name+".TopicManager"); _publishAdapter = ic->createObjectAdapter(name + ".Publish"); ISServer = IceStorm::Service::create( ic, _topicAdapter, _publishAdapter, name, ide, db ); cout << "the IceBox::IceStorm Start!!!" << endl; int i; cin >> i; ISServer->stop(); ic->destroy(); } this is the config.IceStormServer below: Ice.Override.ConnectTimeout=10000 Ice.Override.Timeout=20000 Ice.RetryIntervals=5 Ice.Trace.Protocol=1 Ice.Trace.Network=1 IceStorm.InstanceName=DemoIceStorm IceStorm.TopicManager.Endpoints=default -p 10000 IceStorm.InstanceName=DemoIceStorm IceStorm.Publish.Endpoints=tcp -p 10001:udp -p 10001 IceStorm.Trace.TopicManager=2 IceStorm.Trace.Topic=1 IceStorm.Trace.Subscriber=1 IceStorm.Trace.Flush=1 IceStorm.Flush.Timeout=2000 The function can start successfully ,but when i used publisher.exe and subscriber.exe in Demo/IceStorm/clock to test it , it can't work. and i hope it can work as "icebox --Ice.Config=config.icebox". This is the trace of the publisher below: [ 03/20/08 21:02:16.487 Network: trying to establish tcp connection to 127.0.0.1 :10000 ] [ 03/20/08 21:02:16.523 Network: tcp connection established local address = 127.0.0.1:55521 remote address = 127.0.0.1:10000 ] Where is my error or did I misunderstood something? Last edited by caihua2007 : 03-20-2008 at 10:14 AM. |
|
|||||
|
it could work when i add adapter->activate.
Thank you for your help. Icebox frequently hang up ,and i don't know why ,so i want to start it in the program, maybe i can find the key to figure it out . hehe |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| IceStorm as Windows Service | amercieca | Help Center | 2 | 10-08-2007 12:56 PM |
| Suggestion: Service/daemon class for .NET | kwaclaw | Comments | 1 | 09-04-2007 09:33 PM |
| Ice::Service Class in C#? | amrufon | Help Center | 7 | 09-14-2006 05:26 AM |
| Very busy IceStorm service | Nis Baggesen | Help Center | 11 | 03-16-2006 04:47 PM |
| How to trap signal in ICE::Service Class | dragzhb | Help Center | 6 | 09-15-2004 11:50 PM |