Well, try this:
1. First apply patch (attached). This patch makes possible of using real values 
for throughput. For instance:
throughput = 0.5
2. Make changes to smsc_smpp.c. I have big patch with different things changed, 
so I'll describe what needs to be done literally. sorry...
2.1. Add #include <unistd.h>
2.2. Add time_t last_msg_sent; to typedef struct {...
} SMPP;
2.3. Add smpp->last_msg_sent = 0; to static SMPP *smpp_create (...) {...};
2.4. Modify static void send_messages () {};
2.4.1. Just after
while (*pending_submits < smpp->max_pending_submits) {
add this code:

if (difftime(time(NULL),smpp->last_msg_sent) < delay) {
            sleep((unsigned int)(delay - 
difftime(time(NULL),smpp->last_msg_sent)));
        }

2.4.2. move few lines down and add
smpp->last_msg_sent=time(NULL);
just after ++(*pending_submits);

Done.
To be correct, I'm not a guru at thread programming and it might look dirty, 
but this hack works though. We faced an operator which required us to obey the 
speed limit at 2 SMS/MIN!!! during the testing phase. After we passed all tests 
they allowed us to drive at 0.5 SMS/sec. There was no workaround for this 
problem and we needed this hack.
It would be nice if someone can make it more neatly and can share it with the 
community.

Michael

Attachment: throughput.patch.gz
Description: Binary data

Reply via email to