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); } }
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; }
public NetworkHost(IWSComm awsComm, Uri baseAddress, String alias, string ipAddressRange) { _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 = "True"; IsRunning = false; }
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; }
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); } } }