/*=========================*/
        #endregion

        #region Communication
        /*=========================*/

        void OpenChannelAndSubscribe()
        {
            // Open the communication channel
            _commChannel = new ServiceEngineCommChannel(this);
            _commChannel.Open();

            // Subscribe to the engine's notifications
            _commChannel.Engine.Subscribe();

            // Change state to ready
            State = ServiceState.Ready;
        }
Ejemplo n.º 2
0
        /*=========================*/
        #endregion

        #region Initialization
        /*=========================*/

        /// <summary>
        ///
        /// </summary>
        internal void Init(ServiceInstanceInfo instance)
        {
            _instance = instance;
            _log      = new Log(instance);

            if (_wcfHost == null)
            {
                _wcfHost = new ServiceEngineHost(this);

                Binding binding = ServiceEngineCommChannel.GetBinding(instance);

                // Other service endpoints are added automatically from configuration
                _wcfHost.AddServiceEndpoint(typeof(IServiceEngine), binding, instance.ServiceUrl);

                // Open the listener
                _wcfHost.Open();
            }

            OnInit();
        }