Re: smpp reconnect bugfix

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>
> Yep - that's my problem. how about the following complicated logic:
> whenever the receiver thread wants to change the status, it will check
> if it has a transmitter thread attached, and if so will do the
> following:
> if (its_safe_to_change_status()) {
>         if (new_status = SMSCCONN_ACTIVE_RECV)
>                 status = privdata->current_state
>         else {
>                 privdata->current_state = status;
>                 status = new_status;
>                 privdata->new_status = new_status;
>         }
> } else {
>         deinit_privdata_status_variables();
> }
> 
> its_safe_to_change_status() {
>         if ( ! privdata_status_variables_have_been_inited)
>                 return false;
>         if (privdata->new_status == status)
>                 return true;
>         return false;
> }
> 
> a bit complicated, but I think it'll be safe enough - the point of the
> excersize is to allow the receiver thread to change the status while
> giving precedense to the status set by the transmitter, and instead of
> setting SMSCCONN_ACTIVE_RECV, restore the status set by the transmitter.
> 
> Comments please ?

Ok, I understood the problem now, summarizing:

If a SMPP link uses a transmitter and receiver thread and the receiver
thread break and loops in re-connecting cycle, then no messages will
be send of the still existing and alive transmitter thread, right?!
And when the receiver thread successfully reconnects it will only set
status to SMSCONN_ACTIVE_RECV which will then again cause to block
sending of messages because the module expects SMSCCONN_ACTIVE to be
set when sending.

Hmmm, I haven't understood the patch Oded. Can you point that a bit
more out and tell us where it should be placed in the code?

Stipe

[email protected]
-------------------------------------------------------------------
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [email protected]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.