Peer connections.
Copyright (c) 2015 Jean Parpaillon
Behaviours: dbus_connection
, gen_fsm
.
Authors: Jean Parpaillon (jean.parpaillon@free.fr
).
auth/1 | Launch authentication on this connection No message can be sent before authentication. |
authenticated/3 | |
call/2 | Synchronously send a message. |
cast/2 | Asynchronously send a message. |
close/1 | Close the connection. |
code_change/4 | |
connected/3 | Default is to use EXTERNAL mechanism first. |
handle_event/3 | |
handle_info/3 | |
handle_sync_event/4 | |
init/1 | |
set_controlling_process/2 | Change controlling process for the connection. |
start_link/1 | Equivalent to start_link(BusId, [list, {packet, 0}]). |
start_link/2 | Start a connection to a peer. |
terminate/3 | |
waiting_for_agree/3 | |
waiting_for_data/3 | |
waiting_for_ok/3 | |
waiting_for_reject/3 |
auth(Conn::pid()) -> {ok, ConnexionId::undefined | binary()} | {error, term()}
Launch authentication on this connection No message can be sent before authentication.
authenticated(Evt, From, State) -> any()
call(Conn::pid(), Dbus_message::dbus_message()) -> {ok, term()} | {error, term()}
Synchronously send a message
cast(Conn::pid(), Dbus_message::dbus_message()) -> ok | {error, term()}
Asynchronously send a message
close(Conn::pid()) -> ok
Close the connection
code_change(OldVsn, StateName, State, Extra) -> any()
connected(Evt, From, State) -> any()
Default is to use EXTERNAL mechanism first. If it fails, server will answer with list of possible authentications. Mimic C implementation
handle_event(Evt, StateName, State) -> any()
handle_info(Evt, StateName, State) -> any()
handle_sync_event(Evt, From, StateName, State) -> any()
init(X1) -> any()
set_controlling_process(Connection::pid(), Client::pid()) -> ok | {error, unauthorized}
Change controlling process for the connection.
If called by someone else than current owner, {error, unauthorized}
is returned.
start_link(BusId::bus_id()) -> {ok, dbus_connection()} | {error, term()}
Equivalent to start_link(BusId, [list, {packet, 0}])
.
start_link(BusId::bus_id(), Options::list()) -> {ok, dbus_connection()} | {error, term()}
Start a connection to a peer
terminate(Reason, StateName, State) -> any()
waiting_for_agree(Evt, From, State) -> any()
waiting_for_data(Evt, From, State) -> any()
waiting_for_ok(Evt, From, State) -> any()
waiting_for_reject(Evt, From, State) -> any()