Page 1 of 1

Event thread safety

Posted: Wed Jun 25, 2014 8:21 am
by norman
Hi,

Must the client_evSubmitComplete event be thread safe?
i.e. in a async model is it possible for the event to be fired again before the preceding event has completed?

Thanks!

Re: Event thread safety

Posted: Wed Jun 25, 2014 9:42 am
by alt
Hi norman,

SmppClient has by default 3 working threads that process received messages. When SubmitSmResp received one of the thread raises evSubmitComplete event.
Therefore evSubmitComplete event can be fired again before the preceiding event has completed.

Re: Event thread safety

Posted: Wed Jun 25, 2014 11:39 am
by norman
Thanks, that probably explains why I am losing data. I will lock the event handler - unless someone has a better suggestion.