Avahi.EntryGroup.AddService C# (CSharp) Method

AddService() public method

public AddService ( int iface, Protocol proto, PublishFlags flags, string name, string type, string domain, string host, UInt16 port ) : void
iface int
proto Protocol
flags PublishFlags
name string
type string
domain string
host string
port System.UInt16
return void
        public void AddService(int iface, Protocol proto, PublishFlags flags, string name, string type, string domain,
                                string host, UInt16 port, params string[] txt)
        {
            IntPtr list = avahi_string_list_new (IntPtr.Zero);

            if (txt != null) {
                foreach (string item in txt) {
                    list = avahi_string_list_add (list, Utility.StringToBytes (item));
                }
            }

            AddService (iface, proto, flags, name, type, domain, host, port, list);
        }

Same methods

EntryGroup::AddService ( PublishFlags flags, string name, string type, string domain, UInt16 port ) : void
EntryGroup::AddService ( int iface, Protocol proto, PublishFlags flags, string name, string type, string domain, string host, UInt16 port, IntPtr list ) : void
EntryGroup::AddService ( string name, string type, string domain, UInt16 port ) : void

Usage Example

    public static void Main()
    {
        client = new Client ();

        Console.WriteLine ("joined service name: " + Client.JoinServiceName ("FooBar", "_foo", "local"));

        EntryGroup eg = new EntryGroup (client);
        eg.StateChanged += OnEntryGroupChanged;
        eg.AddService ("foobar2", "_dingdong._tcp", client.DomainName,
                       444, new string[] { "foo=stuff", "bar=stuff2", "baz=stuff3" });
        eg.Commit ();
        BrowseServiceTypes ("local");
        Console.WriteLine ("Press enter to quit");
        Console.ReadLine ();
    }
All Usage Examples Of Avahi.EntryGroup::AddService