Example #1
0
        public void EncodeDecodeDiscoveryResponse()
        {
            var response = new DiscoveryResponse("tcpex://some:123/SomeService", "1.0");
            var encoded = DiscoveryMetadataHelper.Encode(response);
            var decoded = DiscoveryMetadataHelper.Decode(encoded);

            Assert.IsNotNull(decoded);
            Assert.AreEqual(response, decoded);
        }
Example #2
0
        private void ServerDiscovered(DiscoveryResponse response)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new Action<DiscoveryResponse>(ServerDiscovered), response);
                return;
            }

            _comboServerUrl.Items.Remove(discoveryMessage);
            _comboServerUrl.SelectedIndex = _comboServerUrl.Items.Add(response.HostUrl);
        }
Example #3
0
        public void RequestResponseMatch()
        {
            var req = new DiscoveryRequest("UltimaService");
            var rsp = new DiscoveryResponse("tcp://*****:*****@"\c");
            Assert.IsFalse(rsp.Matches(req));

            req = new DiscoveryRequest(@")");
            Assert.IsFalse(rsp.Matches(req));
        }