linxGnu / gosmpp

Smpp (3.4) Client Library for Go
Apache License 2.0
155 stars 62 forks source link

OnAllPdu users are now able to return a bool to close the bind #120

Closed laduchesneau closed 1 year ago

laduchesneau commented 1 year ago

What: OnAllPdu setting did not allow users to report bind closing status. This caused an io error when users responded to a unbind request.

Why: The change allow users to send back a bool to let the app close the bind, if needed, like with a unbind request.

How: The OnAllPDU is called from handleOrClose function, that has a return value to close the bind. The OnAllPdu will also have a bool return value and that value is forward to the handleorClose function. If the OnCallPdu is returned with a true value, handleOrClose will initiate the close status, like it does without the OnAllPdu setting.

This change also include some other minor changes: