Page 1 of 1

How to enable SendSpeedLimit in SmppServer

Posted: Tue Apr 11, 2017 8:16 am
by murtz
Hi,

I'm writing a SmppReceiver app using the SmppServer class where multiple clients will connect to this server with 1 or more binds. I want to limit the number of messages that they can submit to my server per bind. How can I achieve this?

I know of a property 'SendSpeedLimit' in SmppClient class which limits number of messages sent to the server. Is there a similar property available within SmppServer class that can be assigned to each connected client?

Re: How to enable SendSpeedLimit in SmppServer

Posted: Wed Apr 19, 2017 9:29 pm
by alt
Hi murtz,

SendSpeedLimit is not yet supported in SmppServerClient class.

How do you see SmppServer should handle over limit?

Re: How to enable SendSpeedLimit in SmppServer

Posted: Thu May 18, 2017 5:44 am
by murtz
Hi alt,

How about implementing the same logic that is there within SmppClient?

On exceeding this limit, the server can return THROTTLING_ERROR.

Re: How to enable SendSpeedLimit in SmppServer

Posted: Fri May 19, 2017 12:10 pm
by alt
This logic has been added in release 1.2.
Please check ChangeLog

Re: How to enable SendSpeedLimit in SmppServer

Posted: Tue May 30, 2017 7:56 am
by murtz
Hi,
I believe there is a problem in ReceiveSpeedLimit property.
I have checked the source code and can see that the stopwatch is reset every time it is being accessed. This results in returning ESME_RTHROTTLED for every communication, even for Bind event.
Also, I do not know why would you need to check this limit in case of Bind.

Re: How to enable SendSpeedLimit in SmppServer

Posted: Wed May 31, 2017 3:13 pm
by alt
You are right, there is no sense to check limit for Bind.
I'll fix it in the next version.

Re: How to enable SendSpeedLimit in SmppServer

Posted: Thu Jun 01, 2017 7:59 am
by murtz
Do check your rate limiting logic also. The problem I see in your code for both SendSpeedLimit and ReceiveSpeedLimit is that you're restricting PDUs from sending/receiving during a given time based on the gap between that PDU and the last PDU sent/received.
This shouldn't be always true. Take below scenario for example,

- I set the SendSpeedLimit to 5 SMS/sec.
- I try to send 5 SMS at exactly the same time.
- The current logic will keep a gap of 200ms between each PDU submission which is not necessary. It should allow to send all 5 PDUs at the same time but if the 6th PDU comes during the same second, then only it should wait for that timespan to complete before submitting the next PDU.

The same goes for ReceiveSpeedLimit.

You can look into this for a good alternative for RateLimitting. http://www.jackleitch.net/2010/10/bette ... h-dot-net/

Let me know your thoughts

Thanks

Re: How to enable SendSpeedLimit in SmppServer

Posted: Thu Jun 01, 2017 9:00 am
by alt
thank you for suggestion.

I think it is good for ReceiveSpeedLimit, but it won't work for client's SendSpeedLimit when remote server checks gap between two PDUs.