Exemple #1
0
        public NetworkHost(T service, Uri address)
        {
            TCPBinding binding = new TCPBinding();

            HostService  = new ServiceHost(service, address);
            HostEndpoint = HostService.AddServiceEndpoint(typeof(T), binding, string.Empty);
            Debug.Assert(!IsRunning);
        }
Exemple #2
0
        public NetworkHost(T service, Uri address, List <DiscoveryMetadata> metaData)
        {
            HostMetadata = metaData;
            TCPBinding binding = new TCPBinding();

            HostService  = new ServiceHost(service, address);
            HostEndpoint = HostService.AddServiceEndpoint(typeof(T), binding, string.Empty);
            Debug.Assert(!IsRunning);
        }
Exemple #3
0
        public NetworkHost(T service, Uri baseAddress)
        {
            m_ServiceHost = new ServiceHost(service, baseAddress);

            //list max buffer size limit
            TCPBinding tcpbinding = new TCPBinding();

            m_NetEndpoint = m_ServiceHost.AddServiceEndpoint(typeof(T), tcpbinding, string.Empty);
            IsRunning     = false;
        }
Exemple #4
0
        public NetworkHost(T service, Uri address, List <DiscoveryMetadata> metaData, int timeoutReceive, int timeoutSend)
        {
            HostMetadata = metaData;
            TCPBinding binding = new TCPBinding();

            binding.ReceiveTimeout = new TimeSpan(0, timeoutReceive, 0);
            binding.SendTimeout    = new TimeSpan(0, timeoutSend, 0);
            HostService            = new ServiceHost(service, address);
            HostEndpoint           = HostService.AddServiceEndpoint(typeof(T), binding, string.Empty);
            Debug.Assert(!IsRunning);
        }
Exemple #5
0
        public NetworkHost(ICaseRequestManager caseRequestManager, Uri baseAddress, string alias)
        {
            _serviceHost = new ServiceHost(caseRequestManager, baseAddress);

            //list max buffer size limit
            TCPBinding tcpbinding = new TCPBinding();

            _netTcpEndpoint = _serviceHost.AddServiceEndpoint(typeof(ICaseRequestManager), tcpbinding, String.Empty);
            _metaDataElementValue = "*";
            _metaDataAliasValue = alias;
            _metaDataLogInValue = "False";
            IsRunning = false;
        }
Exemple #6
0
        public NetworkHost(IWSComm awsComm, Uri baseAddress, String alias)
        {
            _serviceHost = new ServiceHost(awsComm, baseAddress);

            //list max buffer size limit
            TCPBinding tcpbinding = new TCPBinding();

            _netTcpEndpoint = _serviceHost.AddServiceEndpoint(typeof(IWSComm), tcpbinding, string.Empty);
            _metaDataElementValue = "*";
            _metaDataAliasValue = alias;
            _metaDataLogInValue = "True";
            IsRunning = false;
        }
Exemple #7
0
        public NetworkHost(T service, Uri baseAddress, List <DiscoveryMetadata> list, int receiveTimeout, int sendTimeout)
        {
            m_ServiceHost = new ServiceHost(service, baseAddress);

            //list max buffer size limit
            TCPBinding tcpbinding = new TCPBinding();

            tcpbinding.SendTimeout    = new TimeSpan(0, sendTimeout, 0);
            tcpbinding.ReceiveTimeout = new TimeSpan(0, receiveTimeout, 0);

            m_NetEndpoint  = m_ServiceHost.AddServiceEndpoint(typeof(T), tcpbinding, string.Empty);
            IsRunning      = false;
            m_MetadataList = list;
        }
Exemple #8
0
        private void ListenForAWSComm()
        {
            Boolean createdPanel = false;
            HostDiscovery awsCommDiscovery = new HostDiscovery(typeof(IWSComm), new TimeSpan(0, 0, 0, 1, 0));

            while (!createdPanel)
            {

                Collection<EndpointDiscoveryMetadata> AWSCommEndpoints = awsCommDiscovery.GetAvailableConnections();

                if (AWSCommEndpoints.Count > 0)
                {
                    for (Int32 index = 0; index < AWSCommEndpoints.Count; index++)
                    {

                        foreach (XElement xElement in AWSCommEndpoints[index].Extensions)
                        {
                            try
                            {
                                String alias = xElement.Element("HostAlias").Value;
                                break;
                            }
                            catch
                            {
                                continue;
                            }
                        }

                        InstanceContext awsCommCallback = new InstanceContext(new WSCommCallback());

                        TCPBinding tcpbinding = new TCPBinding();

                        ServiceEndpoint HostEndPoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(IWSComm)), tcpbinding, AWSCommEndpoints[index].Address);

                        if (index == 0)
                        {
                            // Connect and setup our endpoint
                            m_AWSCommEndPoint1 = new WSCommEndpoint(awsCommCallback, HostEndPoint);
                            tabItem1.Visibility = System.Windows.Visibility.Visible;
                            Tab1Grid.Visibility = System.Windows.Visibility.Visible;

                            Thread Conn1Ping = new Thread(new ThreadStart(PingHost));
                            Conn1Ping.Start();
                        }
                        else if (index == 1)
                        {
                            m_AWSCommEndPoint2 = new WSCommEndpoint(awsCommCallback, HostEndPoint);
                            tabItem2.Visibility = System.Windows.Visibility.Visible;
                            Tab2Grid.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (index == 2)
                        {
                            m_AWSCommEndPoint3 = new WSCommEndpoint(awsCommCallback, HostEndPoint);
                            tabItem3.Visibility = System.Windows.Visibility.Visible;
                            Tab3Grid.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (index == 3)
                        {
                            m_AWSCommEndPoint4 = new WSCommEndpoint(awsCommCallback, HostEndPoint);
                            tabItem4.Visibility = System.Windows.Visibility.Visible;
                            Tab4Grid.Visibility = System.Windows.Visibility.Visible;
                        }

                        //Show the Tab Page
                    }
                    createdPanel = true;
                }
                else
                {
                    Thread.Sleep(10000);
                }
            }
        }
Exemple #9
0
        public NetworkHost(ITipManager tipManager, Uri baseAddress, String alias, String ipAddressRange)
        {
            _serviceHost = new ServiceHost(tipManager, baseAddress);

            //list max buffer size limit
            TCPBinding tcpbinding = new TCPBinding();

            _netTcpEndpoint = _serviceHost.AddServiceEndpoint(typeof(ITipManager), tcpbinding, String.Empty);
            _metaDataElementValue = ipAddressRange;
            _metaDataAliasValue = alias;
            IsRunning = false;
        }
Exemple #10
0
        public NetworkHost (IWSComm awsComm, Uri baseAddress, String alias, string ipAddressRange, bool isLogginRequired)
        {
            _serviceHost = new ServiceHost(awsComm, baseAddress);

            //list max buffer size limit
            TCPBinding tcpbinding = new TCPBinding();

            _netTcpEndpoint = _serviceHost.AddServiceEndpoint(typeof(IWSComm), tcpbinding, string.Empty);
            _metaDataElementValue = ipAddressRange;
            _metaDataAliasValue = alias;
            _metaDataLogInValue = isLogginRequired.ToString();
            IsRunning = false;
        }
Exemple #11
0
        private void ListenForACSComm()
        {
            Boolean createdPanel = false;
            HostDiscovery awsCommDiscovery = new HostDiscovery(typeof(ICaseRequestManager), new TimeSpan(0, 0, 0, 1, 0));

            while (!createdPanel)
            {

                Collection<EndpointDiscoveryMetadata> ACSCommEndpoints = awsCommDiscovery.GetAvailableConnections();

                if (ACSCommEndpoints.Count > 0)
                {
                    for (Int32 index = 0; index < ACSCommEndpoints.Count; index++)
                    {
                        InstanceContext acsCommCallback = new InstanceContext(new CACSCaseRequestManagerCallback(this));

                        TCPBinding tcpbinding = new TCPBinding();                        

                        ServiceEndpoint HostEndPoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(ICaseRequestManager)), tcpbinding, ACSCommEndpoints[index].Address);

                        if (index == 0)
                        {
                            // Connect and setup our endpoint
                            ACSEndPoint = new CaseRequestManagerEndpoint(acsCommCallback, HostEndPoint);
                            //tabItem1.Visibility = System.Windows.Visibility.Visible;
                            //Tab1Grid.Visibility = System.Windows.Visibility.Visible;

                            Thread Conn1Ping = new Thread(new ThreadStart(PingHost));
                            Conn1Ping.Start();
                        }
                          
                        else if (index == 1)
                        {
                            //m_AWSCommEndPoint2 = new AWSCommEndpoint(awsCommCallback, HostEndPoint);
                            //tabItem2.Visibility = System.Windows.Visibility.Visible;
                            //Tab2Grid.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (index == 2)
                        {
                           // m_AWSCommEndPoint3 = new AWSCommEndpoint(awsCommCallback, HostEndPoint);
                          //  tabItem3.Visibility = System.Windows.Visibility.Visible;
                           // Tab3Grid.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (index == 3)
                        {
                           // m_AWSCommEndPoint4 = new AWSCommEndpoint(awsCommCallback, HostEndPoint);
                           // tabItem4.Visibility = System.Windows.Visibility.Visible;
                            //Tab4Grid.Visibility = System.Windows.Visibility.Visible;
                        }
                        
                        //Show the Tab Page
                    }
                    createdPanel = true;
                }
                Thread.Sleep(10000);
            }
        }