Example #1
0
        private void InitiateShutdown()
        {
            if ((tvNodes.Items.Count == 0) || (tvNodes.SelectedValue == null))
            {
                return;
            }

            Func<Node, bool> nodeFinder = (x => x.EndPoint.ToString().CompareTo(tvNodes.SelectedValue) == 0);
            Node node = _nodeTracker.ActiveNodes.First<Node>(nodeFinder);
            if (node == null)
            {
                MessageBox.Show("Could not locate the node service entry. Shutdown call will not be made.");
                return;
            }

            //for this node, get the active data from the node
            string endPoint = string.Format("net.tcp://{0}:{1}/HoCCacheService", node.EndPoint.ToString(), node.ServicePort);
            CacheService.CacheServiceClient nodeService = new CacheService.CacheServiceClient(new NetTcpBinding(SecurityMode.None), new EndpointAddress(endPoint));
            nodeService.Open();
            nodeService.Stop();

            MessageBox.Show("Successfully called Shutdown on server : " + tvNodes.SelectedValue);
        }