public static int Main(string[] args) { // Is Beagle up? DaemonInformationRequest infoReq = new DaemonInformationRequest(); try { infoReq.Send(); } catch { Console.Error.WriteLine("Error: beagled does not appear to be running"); return(-1); } Bus bus = Bus.Session; ObjectPath opath = new ObjectPath("/org/freedesktop/xesam/searcher/main"); string service = "org.freedesktop.xesam.searcher"; Searcher search = new Searcher(); bus.Register(service, opath, search); RequestNameReply nameReply = bus.RequestName(service); System.Threading.Thread t = new System.Threading.Thread(BusIterate); t.Start(); MainLoop ml = new MainLoop(); ml.Run(); return(0); }
public void RegisterServer() { RequestNameReply nameReply = Bus.Session.RequestName(ServicePath, NameFlag.DoNotQueue); #if DEBUG_DBUS Console.WriteLine("RequestNameReply {0}", nameReply); #endif Bus.Session.Register(ServicePath, CorePath, this); }
private static RequestNameReply Connect(string serviceName, bool init) { connect_tried = true; if (init) { BusG.Init(); } string bus_name = MakeBusName(serviceName); RequestNameReply name_reply = Bus.Session.RequestName(bus_name); Log.DebugFormat("Bus.Session.RequestName ('{0}') replied with {1}", bus_name, name_reply); return(name_reply); }