{"id":7238,"date":"2022-12-20T19:35:57","date_gmt":"2022-12-20T22:35:57","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/netdbusbindingserver-man3\/"},"modified":"2022-12-20T19:35:57","modified_gmt":"2022-12-20T22:35:57","slug":"netdbusbindingserver-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/netdbusbindingserver-man3\/","title":{"rendered":"Net::DBus::Binding::Server (man3)"},"content":{"rendered":"<h1 align=\"center\">Net::DBus::Binding::Server<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#METHODS\">METHODS<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Net::DBus::Binding::Server \u2212 A server to accept incoming connections<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Creating a new server and accepting client connections<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">use Net::DBus::Binding::Server; <br \/> my $server = Net::DBus::Binding::Server\u2212>new(address => &#8220;unix:path=\/path\/to\/socket&#8221;); <br \/> $server\u2212>connection_callback(&#038;new_connection); <br \/> sub new_connection { <br \/> my $connection = shift; <br \/> .. work with new connection&#8230; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Managing the server and new connections in an event loop<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">my $reactor = Net::DBus::Binding::Reactor\u2212>new(); <br \/> $reactor\u2212>manage($server); <br \/> $reactor\u2212>run(); <br \/> sub new_connection { <br \/> my $connection = shift; <br \/> $reactor\u2212>manage($connection); <br \/> }<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A server for receiving connection from client programs. The methods defined on this module have a close correspondence to the dbus_server_XXX methods in the C <small>API,<\/small> so for further details on their behaviour, the C <small>API<\/small> documentation may be of use.<\/p>\n<h2>METHODS <a name=\"METHODS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">my $server = Net::DBus::Binding::Server\u2212>new(address => <br \/> &#8220;unix:path=\/path\/to\/socket&#8221;);<\/p>\n<p style=\"margin-left:17%;\">Creates a new server binding it to the socket specified by the &#8220;address&#8221; parameter.<\/p>\n<p style=\"margin-left:11%;\">$status = $server\u2212><b>is_connected()<\/b>;<\/p>\n<p style=\"margin-left:17%;\">Returns zero if the server has been disconnected, otherwise a positive value is returned.<\/p>\n<p style=\"margin-left:11%;\">$server\u2212><b>disconnect()<\/b><\/p>\n<p style=\"margin-left:17%;\">Closes this server to the remote host. This method is called automatically during garbage collection (ie in the <small>DESTROY<\/small> method) if the programmer forgets to explicitly disconnect.<\/p>\n<p style=\"margin-left:11%;\">$server\u2212>set_watch_callbacks(&#038;add_watch, &#038;remove_watch, <br \/> &#038;toggle_watch);<\/p>\n<p style=\"margin-left:17%;\">Register a set of callbacks for adding, removing &#038; updating watches in the application\u2019s event loop. Each parameter should be a code reference, which on each invocation, will be supplied with two parameters, the server object and the watch object. If you are using a &#8220;Net::DBus::Binding::Reactor&#8221; object as the application event loop, then the \u2019manage\u2019 method on that object will call this on your behalf.<\/p>\n<p style=\"margin-left:11%;\">$server\u2212>set_timeout_callbacks(&#038;add_timeout, &#038;remove_timeout, <br \/> &#038;toggle_timeout);<\/p>\n<p style=\"margin-left:17%;\">Register a set of callbacks for adding, removing &#038; updating timeouts in the application\u2019s event loop. Each parameter should be a code reference, which on each invocation, will be supplied with two parameters, the server object and the timeout object. If you are using a &#8220;Net::DBus::Binding::Reactor&#8221; object as the application event loop, then the \u2019manage\u2019 method on that object will call this on your behalf.<\/p>\n<p style=\"margin-left:11%;\">$server\u2212>set_connection_callback(&#038;handler)<\/p>\n<p style=\"margin-left:17%;\">Registers the handler to use for dealing with new incoming connections from clients. The code reference will be invoked each time a new client connects and supplied with a single parameter which is the &#8220;Net::DBus::Binding::Connection&#8221; object representing the client.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Daniel P. Berrange<\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Copyright (C) 2004\u22122011 Daniel P. Berrange<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Net::DBus::Binding::Connection, Net::DBus::Binding::Bus, Net::DBus::Binding::Message::Signal, Net::DBus::Binding::Message::MethodCall, Net::DBus::Binding::Message::MethodReturn, Net::DBus::Binding::Message::Error<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Net::DBus::Binding::Server \u2212 A server to accept incoming connections <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3007,3564],"class_list":["post-7238","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-man3","tag-netdbusbindingserver"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7238"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7238\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}