[libnet-dbus-perl] 35/335: Allow an address to be specified instead of well known bus name, for connections to remote buses
Intrigeri
intrigeri at moszumanska.debian.org
Sat Mar 21 01:07:16 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to branch experimental
in repository libnet-dbus-perl.
commit 25408e9922f44b4346dbbf9ee63cc1c8a6a38fb4
Author: Daniel P. Berrange <dan at berrange.com>
Date: Mon Dec 27 16:25:35 2004 +0000
Allow an address to be specified instead of well known bus name, for connections to remote buses
---
lib/Net/DBus/Binding/Bus.pm | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/lib/Net/DBus/Binding/Bus.pm b/lib/Net/DBus/Binding/Bus.pm
index 6afa44b..7acc098 100644
--- a/lib/Net/DBus/Binding/Bus.pm
+++ b/lib/Net/DBus/Binding/Bus.pm
@@ -15,13 +15,21 @@ sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my %params = @_;
-
- my $connection = Net::DBus::Binding::Bus::_open(defined $params{type} ? $params{type} : confess "type parameter is required");
-
+
+ my $connection;
+ if (defined $params{type}) {
+ $connection = Net::DBus::Binding::Bus::_open($params{type});
+ } elsif (defined $params{address}) {
+ $connection = Net::DBus::Binding::Connection::_open($params{address});
+ $connection->dbus_bus_register();
+ } else {
+ confess "either type or address parameter is required";
+ }
+
my $self = $class->SUPER::new(%params, connection => $connection);
bless $self, $class;
-
+
return $self;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-dbus-perl.git
More information about the Pkg-perl-cvs-commits
mailing list