Shannon McCoy:
All CTIOS .NET apps are multithreaded. The CTIOS CIL uses an event based asynchronous model which by its nature executes on a background thread. If you check the example code you must ensure that you switch to the UI thread when responding to an event otherwise your app will throw and exception.
As for "thread safety" the CIL is message based and is in essence a fancy wrapper around a set of GED TCP/IP calls to the CTIOS server. As such the CIL per se does not really manage much state in that any state it does maintain is ultimately rectified by the CTIOS server. So while you may maintain a reference to a CTIOS object its really just a wrapper to hold state for essentially what is connectionless/connected model. Bottom line in just about every circumstance the CIL is thread safe.
Unless you have some sort of configuation where the CTIOS servers are non redundant (A/B side) then there is no point to trying to monitor "ALL" servers because only one will be active at time. If the A side server fails then your app should either automatically fail over to the B side ( in Agent Mode ) or you have to add some code to watch for a failure and reinitialize your connection ( in Monitor Mode ). If you try and connect to an inactive server it will simply fail you over to the active one so as I said its kind of pointless.
To maintain muliple sessions you could have a single event processor open the session and dispatch the messages for all sessions which could get messy or you could simply create an even processor for each session and execute the event processor in its own thread, one per session and essentially have multiple silos running in parallell. You could probably even isolate them into their own App Domain if you want even more seperation and process resilency.
It really comes down to what you are trying to achieve and your post is not descriptive enough of your end goal to make an finer detailed assesment. The bottom line is the .NET is fully capable of doing any kind of design you want and the model that the CIL uses lends itself to being used in multiple different ways without too many limitations. The key will be in understanding how to properly mulithread in .NET and using the proper design patterns to achieve your goal. This is generally a far more limiting factor than the CIL is.
Thank you for your reply. Onething is still not clear that whether CIL(ver 7.5) will allow us to write an application that will do the following things:
To subscribe to all events and data for all agents for a particular CTIOS server and should also be able to control each agent state(transfer, Hold etc.).
Regards,
Basudeb