0

How can i send 2 differents submit_sm in only one SMPP request. it's like 2 differents submit_sm encapsulate in one SMPP request

as the following trace:

SMPP 436 SMPP Submit_sm (Short Message Reassembled), Submit_sm (Short Message Reassembled)

Short Message Peer to Peer, Command: Submit_sm, Seq: 1093, Len: 191 GSM Short Message Service User Data Short Message Peer to Peer, Command: Submit_sm, Seq: 1094, Len: 191 GSM Short Message Service User Data

1 Answers1

0

What you see in your trace as "SMPP request" is actually one TCP packet containing multi SMPP packets of command type "submit_sm".

Your OS is responsible for this buffering and it's not uncommon since the MTU for one TCP packet is about 1500 bytes and depending on the paylaod, the submit_sm packet is less than 200 bytes.

So depends how you interact with your network socket. If you flush after each SMPP packet you write to it, you will get one submit_sm in one TCP packet. Otherwise the will be buffered unti MTU is reached.

In jsmpp, the default implementation of the pdu sender flushes the output stream after each smpp packet (see https://github.com/uudashr/jsmpp/blob/master/jsmpp/src/main/java/org/jsmpp/DefaultPDUSender.java#L216).

You can create a SMPPSession providing your own PDUSender implementation which doesn't flush after each packet (see https://github.com/uudashr/jsmpp/blob/master/jsmpp/src/main/java/org/jsmpp/session/SMPPSession.java#L124).

Martin
  • 640
  • 7
  • 11
  • my question is how can i do this with jsmpp – Slim Baccar May 14 '15 at 20:04
  • actually i made a test with asynchronous mode , so the smpp Client send multiple submit sm in one tcp packet but it's not organized, he send in one tcp packet 3 submit sm and in the other 1 submit sm. i still searching k – Slim Baccar May 15 '15 at 13:20
  • What do you want to achive? What I didn't mention earlier is that you need async smpp to submit multiple submit_sm at once. otherwise you wait after each submit_sm for the submit_sm_resp which is very likely that each submit_sm is in it's on tcp packet. – Martin May 16 '15 at 16:15
  • In async smpp mode, you don't wait for submit_sm_resp and just fire as long as the window isn't full. Here it's likely that you see multiple submit_sm in one tcp packet. However, your application shouldn't care much about how the OS handels tcp traffic. – Martin May 16 '15 at 16:19
  • sorry for the late response, i mades changes in jsmpp, more exactly in writeAndFlush methods, i delete out.flush(); but nothing happens see (https://github.com/uudashr/jsmpp/blob/master/jsmpp/src/main/java/org/jsmpp/DefaultPDUSender.java#L438 – Slim Baccar May 22 '15 at 17:09
  • Please ensure, that you are sending in async mode AND you have enough packets to send. Otherwise you will send only one submit_sm after the other. – Martin May 31 '15 at 19:33