godbus / dbus

Native Go bindings for D-Bus
BSD 2-Clause "Simplified" License
976 stars 225 forks source link

How to register a well known name #337

Closed 8zhiniao closed 2 years ago

8zhiniao commented 2 years ago

I understand that there should have a well known name, then have some object name and interface name, now I test well known name is same as the interface name , then how can i register a separate service name.

8zhiniao commented 2 years ago

reply, err := conn.RequestName("com.github.guelfey.Demo", dbus.NameFlagDoNotQueue) if err != nil { panic(err) } if reply != dbus.RequestNameReplyPrimaryOwner { fmt.Fprintln(os.Stderr, "name already taken") os.Exit(1) }