public async Task StartTagStreamOld(IObserver <Tag> tags)
        {
            tagStreamListener?.Dispose();
            await api.TagStreamKeepAliveTime(1800);

            await api.TagStreamFormat(ListFormat.Custom);

            await api.TagStreamCustomFormat(Tag.CustomFormat);

            await api.AutoModeReset();

            await api.Clear();

            await api.StreamHeader(true);

            await api.NotifyMode(false);

            var ep = new IPEndPoint(EndpointLookup.GetIpOnTheSameNet(IPAddress.Parse(host)), 0);

            tagStreamListener = new AlienTagStreamListener(ep, tags);
            await api.TagStreamAddress(tagStreamListener.EndPoint);

            await api.TagStreamMode(true);

            await api.AutoMode(true);
        }
Example #2
0
 public SimulatorListener(bool acceptSingleClient = true, bool?usePhysicalDevice = null)
 {
     basePort++;
     UsePhysicalDevice       = usePhysicalDevice ?? File.Exists("AlienTests_UsePhysicalDevice");
     this.acceptSingleClient = acceptSingleClient;
     host = EndpointLookup.GetAnyPhysicalIp().ToString();
     if (UsePhysicalDevice)
     {
         return;
     }
     listener = new TcpListener(EndpointLookup.GetAnyPhysicalIp(), basePort);
     listener.Start();
     new Task(AcceptLoop, TaskCreationOptions.LongRunning).Start();
 }
Example #3
0
        //[Fact]
        public void Get_local_address_on_same_subnet()
        {
            var t = EndpointLookup.GetIpOnTheSameNet(IPAddress.Parse("10.0.0.41"));

            t.ToString().ShouldStartWith("10.0.0.");
        }