Net::DBus::Binding::Server Methods

From Alteeve Wiki
Revision as of 02:54, 12 October 2009 by Digimer (talk | contribs) (Created page with '{{dbtut_header}} = new = Usage: <source lang="perl">my $server = Net::DBus::Binding::Server->new(address => "unix:path=/path/to/socket");</source> This creates a new server us…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

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.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
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.