Skip to content

Commit

Permalink
Merge pull request #485 from stephin-thomas/patch-2
Browse files Browse the repository at this point in the history
Update tokio_server_cr.rs
  • Loading branch information
diwic authored Oct 5, 2024
2 parents a24953b + 80172ba commit 8f1fcbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dbus-tokio/examples/tokio_server_cr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
// The instance is configured so that introspection and properties interfaces
// are added by default on object path additions.
let mut cr = Crossroads::new();
let (_, c) = connection::new_session_sync()?;
// Connect to the D-Bus session bus (this is blocking, unfortunately).
let (resource, c) = connection::new_session_sync()?;


// Enable async support for the crossroads instance.
Expand Down Expand Up @@ -53,8 +54,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
// to the crossroads instance.
cr.insert("/hello", &[iface_token], Hello { called_count: 0});

// Connect to the D-Bus session bus (this is blocking, unfortunately).
let (resource, c) = connection::new_session_sync()?;


// We add the Crossroads instance to the connection so that incoming method calls will be handled.
c.start_receive(MatchRule::new_method_call(), Box::new(move |msg, conn| {
Expand Down

0 comments on commit 8f1fcbb

Please sign in to comment.