Behaviours: gen_server
.
gen_id/0 | generate an ID based on UUID v4. |
prepare_id/1 | Ensure the string used as ID in stanza is XML valid. |
send/2 | Send an IQ stanza. |
send/3 | Send an IQ stanza and set the return path. |
send/4 | Send an IQ stanza, set the return path and if there are reply or not. |
send/5 | Send an IQ stanza with return path, reply and the server where to send. |
send_message/1 | Send a message stanza. |
send_message/2 | Send a message stanza. |
send_presence/1 | Send a presence stanza. |
send_presence/2 | Send a presence stanza. |
start_link/0 | Starts the ecomponent main server. |
stop/0 | Stops the ecomponent main server. |
sync_send/2 | Send a packet and wait for the reply. |
sync_send/3 | Send a packet and wait for the reply using a specific server to send. |
sync_send/4 | Send a packet and wait for the reply using a specific server to send and the time to await. |
unprepare_id/1 | Undo de action of prepare_id/1. |
gen_id() -> binary()
generate an ID based on UUID v4.
prepare_id(Data::string()) -> string()
Ensure the string used as ID in stanza is XML valid.
send(Packet::term(), App::atom()) -> ok
Send an IQ stanza. The first param is a Packet in exmpp_xml format. The second param is the app where the IQ is linked, this could be an atom or a PID.
send(Packet::term(), NS::atom(), App::atom()) -> ok
Send an IQ stanza and set the return path. The same as send/2 but adds a middle param, the NS (namespace) referer to the name space of the first element inside the iq stanza.
send(Packet::term(), NS::atom(), App::atom(), Reply::boolean()) -> ok
Send an IQ stanza, set the return path and if there are reply or not. This function is the same as send/3 but adds a new param. The fourth param is for enable or disable the waiting for the reply.
send(Packet::term(), NS::atom(), App::atom(), Reply::boolean(), ServerID::atom()) -> ok
Send an IQ stanza with return path, reply and the server where to send. This function adds a new param. The fifth param is the name of the connection where the stanza should be sent.
send_message(Packet::term()) -> ok
Send a message stanza. The Packet should be in exmpp_xml format.
send_message(Packet::term(), ServerID::atom()) -> ok
Send a message stanza. The Packet should be in exmpp_xml format. This function adds the possibility to select the server for send the stanza.
send_presence(Packet::term()) -> ok
Send a presence stanza. The Packet should be in exmpp_xml format.
send_presence(Packet::term(), ServerID::atom()) -> ok
Send a presence stanza. The Packet should be in exmpp_xml format. This function adds the possibility to select the server for send the stanza.
start_link() -> {ok, Pid::pid()} | {error, Reason::any()}
Starts the ecomponent main server.
stop() -> ok
Stops the ecomponent main server.
sync_send(Packet::term(), NS::atom()) -> #params{} | {error, timeout}
Send a packet and wait for the reply. Send a packet as do send/3, but the return path is the current process for get the response. The first param is a Packet in the exmpp_xml format. The second param is the namespace (NS).
sync_send(Packet::term(), NS::atom(), ServerID::atom()) -> #params{} | {error, timeout}
Send a packet and wait for the reply using a specific server to send. As in send/3, but the return path is the current process for get the response.
sync_send(Packet::term(), NS::atom(), ServerID::atom(), Timeout::pos_integer()) -> #params{} | {error, tiemout}
Send a packet and wait for the reply using a specific server to send and the time to await. As in send/3, but you can specify the timeout in milliseconds.
unprepare_id(Data::string()) -> string()
Undo de action of prepare_id/1.