…dPDU(). Under some network conditions, it is possible for the code to receive a partial package over the socket and erronously throw an IOException for the socket. The specs for read() don't guarantee that the full requested length is read in one call. Using readFully() fixes that problem.
When an smpp session is bound and there are messages waiting on the
smsc side, it is legal for the smsc to send a DeliverSM PDU immediately
after it sends a bind response. Because of the PduProcessorDegree,
there is a race condition were both the BindResp and the DeliverSM can
simultaniously be processed but the DeliverSM will be processed like
the session is still in the open state instead of the bound state. This
patch changes the size of the executorService pool to remove the race
condition. It starts with size 1 in open state and when the session is
bound, the pool will be enlarged to the PduProcessorDegree.
After the smpp session has been closed with close() method, we shouldn't leave any threads running. Any extra threads should have exited before Session.close() exits, otherwise many webapp containers will complain during webapp shutdown or webapp restart