[beast: 1/7] BSE: use the new Rapicorn::Aida::ServerConnection::bind API for startup



commit eaa0b3a342c2d5d4806862ca4458dc1165ff7dba
Author: Tim Janik <timj gnu org>
Date:   Mon Jul 13 04:22:04 2015 +0200

    BSE: use the new Rapicorn::Aida::ServerConnection::bind API for startup

 bse/bsemain.cc |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/bse/bsemain.cc b/bse/bsemain.cc
index b1b43f5..a9cc3a1 100644
--- a/bse/bsemain.cc
+++ b/bse/bsemain.cc
@@ -554,10 +554,15 @@ static void
 init_aida_idl ()
 {
   // setup Aida server connection, so ServerIface::__aida_connection__() yields non-NULL
-  Aida::ObjectBroker::bind<Bse::ServerIface> ("inproc://BSE-" BST_VERSION,
-                                              shared_ptr_cast<Bse::ServerIface> 
(&Bse::ServerImpl::instance()));
+  Aida::ServerConnectionP scon =
+    Aida::ServerConnection::bind<Bse::ServerIface> ("inproc://BSE-" BST_VERSION,
+                                                    shared_ptr_cast<Bse::ServerIface> 
(&Bse::ServerImpl::instance()));
+  if (!scon)
+    sfi_error ("%s: failed to create BSE connection: %s", __func__, g_strerror (errno));
+  static Aida::ServerConnectionP *static_connection = new Aida::ServerConnectionP (scon); // keep connection 
alive for entire runtime
+  (void) static_connection;
   // hook up server connection to main loop to process remote calls
-  AidaGlibSource *source = AidaGlibSource::create (Bse::ServerIface::__aida_connection__());
+  AidaGlibSource *source = AidaGlibSource::create (scon.get());
   g_source_set_priority (source, BSE_PRIORITY_GLUE);
   g_source_attach (source, bse_main_context);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]