Example #1
0
        private void LoadFactory()
        {
            try
            {
                // Load factory
                var          api     = new Api.Ortc("Plugins");
                IOrtcFactory factory = api.LoadOrtcFactory("IbtRealTimeSJ");

                if (factory != null)
                {
                    // Construct object
                    _ortc = factory.CreateClient();

                    if (_ortc != null)
                    {
                        _ortc.Id = "dot_net_client";
                        //_ortc.ConnectionTimeout = 10000;

                        // Handlers
                        _ortc.OnConnected    += new OnConnectedDelegate(ortc_OnConnected);
                        _ortc.OnDisconnected += new OnDisconnectedDelegate(ortc_OnDisconnected);
                        _ortc.OnReconnecting += new OnReconnectingDelegate(ortc_OnReconnecting);
                        _ortc.OnReconnected  += new OnReconnectedDelegate(ortc_OnReconnected);
                        _ortc.OnSubscribed   += new OnSubscribedDelegate(ortc_OnSubscribed);
                        _ortc.OnUnsubscribed += new OnUnsubscribedDelegate(ortc_OnUnsubscribed);
                        _ortc.OnException    += new OnExceptionDelegate(ortc_OnException);
                    }
                }
                else
                {
                    Log("Factory is null");
                }
            }
            catch (Exception ex)
            {
                Log(ex.Message);
            }

            if (_ortc == null)
            {
                Log("ORTC object is null");
            }
        }
        private void LoadFactory()
        {
            try
            {
                // Load factory
                var api = new Api.Ortc("Plugins");
                IOrtcFactory factory = api.LoadOrtcFactory("IbtRealTimeSJ");

                if (factory != null)
                {
                    // Construct object
                    _ortc = factory.CreateClient();

                    if (_ortc != null)
                    {
                        _ortc.Id = "dot_net_client";
                        //_ortc.ConnectionTimeout = 10000;

                        // Handlers
                        _ortc.OnConnected += new OnConnectedDelegate(ortc_OnConnected);
                        _ortc.OnDisconnected += new OnDisconnectedDelegate(ortc_OnDisconnected);
                        _ortc.OnReconnecting += new OnReconnectingDelegate(ortc_OnReconnecting);
                        _ortc.OnReconnected += new OnReconnectedDelegate(ortc_OnReconnected);
                        _ortc.OnSubscribed += new OnSubscribedDelegate(ortc_OnSubscribed);
                        _ortc.OnUnsubscribed += new OnUnsubscribedDelegate(ortc_OnUnsubscribed);
                        _ortc.OnException += new OnExceptionDelegate(ortc_OnException);
                    }
                }
                else
                {
                    Log("Factory is null");
                }
            }
            catch (Exception ex)
            {
                Log(ex.Message);
            }

            if (_ortc == null)
            {
                Log("ORTC object is null");
            }
        }