Net::DBus::Binding::Server Methods

From AN!Wiki
Jump to: navigation, search

 AN!Tools :: Net::DBus Binding Tutorial :: Net::DBus::Binding::Server Methods

Contents

new

Usage:

my $server = Net::DBus::Binding::Server->new(address => "unix:path=/path/to/socket");

This creates a new server using the UNIX socket specified by 'address' parameter. If this file doesn't exist, it will be created.

is_connected

Usage:

my $status=$server->is_connected();

This checks if the associated '$server' is up and listening for client connections. If so, '1' is returned, otherwise '0' is returned.

disconnect

Usage:

$server->disconnect();

This tears down the '$server', killing existing client connections and prevent new connections. This method is called as part of the normal garbage collection, should you not call it directly.

set_watch_callbacks

Usage:

$server->set_watch_callbacks(\&add_watch, \&remove_watch, \&toggle_watch);

This registers three code references used as callbacks for adding, removing and updating watches in the application's event loop. Each referenced code will be passed two arguments; the '$server' object and 'watch' object.

set_timeout_callbacks

Usage:

$server->set_timeout_callbacks(\&add_timeout, \&remove_timeout, \&toggle_timeout);

This registers three code references used as callbacks for adding, removing and updating timeouts in the application's event loop. Each referenced code will be passed two arguments; the '$server' object and 'watch' object.

set_timeout_callbacks

Usage:

$server->set_timeout_callbacks(\&add_timeout, \&remove_timeout, \&toggle_timeout);

This registers three code references used as callbacks for adding, removing and updating timeouts in the application's event loop. Each referenced code will be passed two arguments; the '$server' object and 'watch' object.

set_connection_callback

Usage:

$server->set_connection_callback(\&handler);

This registers a code references used as a callback for handling new client connections. When a client connect, this calls the referenced handler, passing a 'Net::DBus::Binding::Connection' object representing the new connection as the sole argument.

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Us: Alteeve's Niche! Support: Mailing List IRC: #clusterlabs on Freenode   © Alteeve's Niche! Inc. 1997-2019
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.
Personal tools
Namespaces

Variants
Actions
Navigation
projects
Toolbox