Exemplo n.º 1
0
        public override void Open()
        {
            if (proxy == null && Service != null)
            {
                return; // Must be in-process. Nothing to do for Open().
            }
            if (proxy == null && !open)
            {
                CreateProxy();
            }

            if ((proxy.Channel != null) && (proxy.Channel.State != CommunicationState.Created))
            {
                throw new InvalidOperationException("Cannot open an opened or previously closed connection");
            }

            proxy.Open();

            if (proxy.Channel.State != CommunicationState.Opened)
            {
                throw new InvalidOperationException("Could not open the connection");
            }

            open = true;
        }
Exemplo n.º 2
0
        public void Connect()
        {
            if (_proxy == null || (_proxy != null && (_proxy.Channel.State == CommunicationState.Closed || _proxy.Channel.State == CommunicationState.Faulted)))
            {
                if (_proxy != null)
                {
                    _proxy.Dispose();
                }

                _proxy = _infoServiceType.CreateProxy(_server);
                _proxy.OperationTimeout = TimeSpan.FromMinutes(Settings.Default.OperationTimeout);
                _proxy.ChannelFactory.Endpoint.Behaviors.Add(new LogHeaderReaderBehavior());
                _proxy.Open();
            }

            Connection = new InformationServiceConnection((IInformationService)_proxy);
            Connection.Open();

            if (Settings.Default.UseActiveSubscriber && _infoServiceType.SupportsActiveSubscriber)
            {
                _notificationDeliveryServiceProxy = _infoServiceType.CreateNotificationDeliveryServiceProxy(_server, NotificationSubscriber);
                _notificationDeliveryServiceProxy.Open();
                _activeSubscriberAddress = string.Format("active://{0}/SolarWinds/SwqlStudio/{1}", Utility.GetFqdn(), Process.GetCurrentProcess().Id);
                _notificationDeliveryServiceProxy.ReceiveIndications(_activeSubscriberAddress);
                _activeSubscriberInfo = new SubscriberInfo()
                {
                    EndpointAddress    = _activeSubscriberAddress,
                    OpenedSuccessfully = true,
                    DataFormat         = "Xml"
                };
            }
        }
Exemplo n.º 3
0
        public void Connect()
        {
            if (_proxy == null || (_proxy != null && (_proxy.Channel.State == CommunicationState.Closed || _proxy.Channel.State == CommunicationState.Faulted)))
            {
                if (_proxy != null)
                {
                    _proxy.Dispose();
                }

                _proxy = _infoServiceType.CreateProxy(_server);
                _proxy.OperationTimeout = TimeSpan.FromMinutes(Settings.Default.OperationTimeout);
                _proxy.ChannelFactory.Endpoint.Behaviors.Add(new LogHeaderReaderBehavior());
                _proxy.Open();
            }

            Connection = new InformationServiceConnection((IInformationService)_proxy);
            Connection.Open();
        }