示例#1
0
        private string ConnectToBrother()
        {
            TableHelper table = new TableHelper();

            try
            {
                IBrotherConnection proxy = Connect();
                proxy.AreYouAlive();

                response = "Instance 0 is alive.";


                table.AddEvidence(new EvidenceEntity(response));
            }
            catch (Exception e)
            {
                response = "Instance 0 is not alive.";
                table.AddEvidence(new EvidenceEntity(response, e.Message));
            }

            return(response);
        }
        private void Connect()
        {
            ChannelFactory <IBrotherConnection> factory = new ChannelFactory <IBrotherConnection>(new NetTcpBinding(), new EndpointAddress($"net.tcp://127.255.0.2:8888/InputRequest"));

            proxy = factory.CreateChannel();
        }