Ejemplo n.º 1
0
        private void PublishZeroconf()
        {
            var name = "Lightswitch " + Environment.MachineName;

            _netservice = new RegisterService
            {
                Name        = name,
                RegType     = "_lightswitch._tcp",
                ReplyDomain = "",
                Port        = (short)PortSetting
            };

            _netservice.Response += netservice_Response;

            // TxtRecords are optional
            var txtRecord = new TxtRecord
            {
                { "txtvers", "1" },
                { "ServiceName", name },
                { "MachineName", Environment.MachineName },
                { "OS", Environment.OSVersion.ToString() },
                { "IPAddress", "127.0.0.1" },
                { "Version", Utils.ApplicationNameAndVersion }
            };

            //txt_record.Add("Password", "false");
            _netservice.TxtRecord = txtRecord;

            _netservice.Register();
        }
Ejemplo n.º 2
0
        private static void registerZeroconfService()
        {
            //var service = new Mono.Zeroconf.RegisterService();
            var service = new Mono.Zeroconf.Providers.Bonjour.RegisterService();

            service.Name        = Environment.MachineName.ToLower();
            service.RegType     = "_airplay._tcp";
            service.ReplyDomain = "local.";
            service.UPort       = airplayPort;
            service.Register();
        }
Ejemplo n.º 3
0
        private void PublishZeroconf()
        {
            var name = "Lightswitch " + Environment.MachineName;
            _netservice = new Mono.Zeroconf.Providers.Bonjour.RegisterService
            {
                Name = name,
                RegType = "_lightswitch._tcp",
                ReplyDomain = "",
                Port = (short)PortSetting
            };

            _netservice.Response += netservice_Response;

            // TxtRecords are optional
            var txtRecord = new TxtRecord
            {
                {"txtvers", "1"},
                {"ServiceName", name},
                {"MachineName", Environment.MachineName},
                {"OS", Environment.OSVersion.ToString()},
                {"IPAddress", "127.0.0.1"},
                {"Version", Utils.ApplicationNameAndVersion}
            };
            //txt_record.Add("Password", "false");
            _netservice.TxtRecord = txtRecord;

            _netservice.Register();
        }