smppex v0.3.1 SMPPEX.ESME.Sync
SMPPEX.ESME.Sync
is an implementation of SMPPEX.ESME
. It allows to send PDUs
to SMSCs in a syncronous way, i.e. blocking till the response PDU comes.
SMPPEX.ESME.Sync
is an SMPPEX.ESME
, so one can use with SMPPEX.ESME.Sync
all
methods provided by SMPPEX.ESME
like SMPPEX.ESME.send_pdu/2
, etc.
Summary
Functions
A nonblocking version of wait_for_pdus/2
Syncronously sends a PDU and wait for at most timeout
ms for a response PDU
Stops ESME asyncronously
Syncronously wait for incoming PDUs. If the ESME already have some received PDUs, they are returned immediately
Types
awaited ::
{:pdu, pdu :: SMPPEX.Pdu.t} |
{:resp, resp_pdu :: SMPPEX.Pdu.t, original_pdu :: SMPPEX.Pdu.t} |
{:timeout, pdu :: SMPPEX.Pdu.t} |
{:error, pdu :: SMPPEX.Pdu.t, reason :: any}
Functions
Specs
pdus(esme :: pid, timeout) :: [awaited]
A nonblocking version of wait_for_pdus/2
.
The difference is that it always immediately returns a list of items(maybe empty)
and never returns :timeout
or :stop
.
Specs
request(esme :: pid, pdu :: SMPPEX.Pdu.t, timeout :: non_neg_integer) ::
{:ok, resp :: SMPPEX.Pdu.t} |
:timeout |
:stop |
{:error, reason :: term}
Syncronously sends a PDU and wait for at most timeout
ms for a response PDU.
The default timeout is 5000 ms.
The result value is one of:
{:ok, resp}
, whereresp
is a successfully received response PDU;:timeout
if the response PDU was not received withintimeout
;:stop
if the ESME stopped while a response was awaited;{:error, reason}
if the request failed.
Specs
start_link(host :: term, port :: non_neg_integer, opts :: Keyword.t) :: GenServer.on_start
Starts SMPPEX.ESME.Sync
.
opts
is a keyword list of SMPPEX.ESME
options which is directly passed to
the underlying SMPPEX.ESME.start_link/4
call.
Specs
wait_for_pdus(esme :: pid, timeout :: non_neg_integer) ::
[awaited] |
:timeout |
:stop
Syncronously wait for incoming PDUs. If the ESME already have some received PDUs, they are returned immediately.
The default timeout is 5000 ms.
The result value is :timeout
, :stop
or a list of the following items:
{:pdu, pdu}
, wherepdu
is an incoming PDU;{:resp, resp_pdu, original_pdu}
whereresp_pdu
is an incoming reply for a previously sentoriginal_pdu
;{:timeout, pdu}
forpdu
’s which have not received a response within ESME timeout;{:error, pdu, reason}
for outcoming PDUs which were not successfully sent due toreason
;{:ok, pdu}
for outcoming PDUs which were successfully sent.
:timeout
returned value indicates that the ESME didn’t receive any PDUs within timeout
.
:stop
value indicates that the ESME stopped while waiting for incoming PDUs.