Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window Size Parameter #105

Closed
tahseenjamal opened this issue Jul 27, 2023 · 4 comments
Closed

Window Size Parameter #105

tahseenjamal opened this issue Jul 27, 2023 · 4 comments

Comments

@tahseenjamal
Copy link
Contributor

Where do you have the window size parameter ?

@linxGnu
Copy link
Owner

linxGnu commented Aug 14, 2023

@tahseenjamal

what do you mean by window size parameter? could you please explain more

@goten4
Copy link
Collaborator

goten4 commented Aug 14, 2023

The window mechanism is not implemented in the lib, you have to code it.

@tahseenjamal
Copy link
Contributor Author

@linxGnu It is more like how many messages can you send in parallel to SMPP without waiting for acknowledgement

if you set your windows parameter to 5 or 10 then your throughput increases

@linxGnu
Copy link
Owner

linxGnu commented Sep 15, 2023

Thank you for clarifying. Just like @goten4 said, it's not implemented in the lib. There are reasons for it:

  • Keep the lib as small/lean as possible
  • Flexible for everyone to implement their own rate limiter

linxGnu pushed a commit that referenced this issue Jun 15, 2024
…e handler, ExpiredPdus handler and NoRespPdu OnClose handler (#134)

What: 
- Add a submit window via a
[concurrent-map](https://github.com/orcaman/concurrent-map) that tracks
Requests (SubmitSM, EnquireLinks, ReplaceSM, etc..)
- Add functionality to return a expected response with the original sent
PDU
- Add functionality to track PDUs with no response and a timer setting
for when they expire
- Add a max window size setting, to limit the number of outbound request
- Add function call to get current bind window size on Tx and Trx
- Add function call to get a PDU stuck in the submit store when the bind
closes.
- Add an example on how to use new settings
- Add an example on how to implemented a Custom PDU to add any fields to
be tracked

Why: As requested in #126, #105 and #73, the user sometimes needs to
track all requests sent to SMSC. Either to relate a response to a
request, or to track a request that have received no response or even to
limit the number of outgoing request without any response from the SMSC.

How: 
- The main feature, the submit window, works by using a
[concurrent-map](https://github.com/orcaman/concurrent-map) as a
key/value store. The key is the PDU sequence number and the value is a
new Request struct created for this feature. Concurrent-map is thread
safe and has all the functionality needed for this use case. The map
gets reset on every rebind and all PDUs stored in the map are can be
retruned to the user via a func call when the session is closed.
- When the user Submits a PDU, it is stored in the new Request struct
with the request is created
- When the library receives a PDU from the SMSC, it will verify if the
PDU is a response type (SubmitSMResp, ReplaceSMResp, etc) and queries
the key/value store with the sequence number. If the store contains a
PDU request, the response is returned to the user with the PDU and the
original request via OnExpectedPduResponse setting. The Request is
removed from the store after the lookup.
- Receivable has been modified to add a new loopWithVerifyExpiredPdu,
that verifies all PDU in the store and compare the time they were
stored. If the time is great than the value entered by the setting
PduExpireTimeOut, the PDU is removed from the store and return to the
user via OnExpiredPduRequest.

The submit window will only contain PDU that return true on CanResponse,
except Unbind and BindRequest:
- CancelSM
- DataSM
- DeliverSM
- EnquireLink
- QuerySM
- ReplaceSM
- SubmitMulti
- SubmitSM

This PR does not break current user experience, all old test pass and if
user does not add the new settings, all will work as it previously did.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants