Skip to content

bug fixes and enhanchments to some java interfaces #2

merged 12 commits into from Feb 17, 2012

2 participants


No description provided.

stefanth added some commits Feb 14, 2012
@stefanth stefanth Fix failure message in StringValidationTest unit test (incorrect leng…
…th indicated)
@stefanth stefanth Add methods to ClientSession interface so that it can be used as a us…
…eful SMPP session. This allows creating objects that behave like SMPP sessions without subclassing the heavy-weight AbstractSession or SMPPSession classes.
@stefanth stefanth Raise ProcessRequestException in fireAcceptDeliverSm() if there is no…
… MessageReceiverListener set, otherwise the smpp server will receive an ok for a message that was not correctly delivered
@stefanth stefanth Use readFully() instead of read() for reading in DefaultPDUReader.rea…
…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.
@stefanth stefanth the method onStateChange() in an SessionStateListener interface alway…
…s receives a session, so the passed object can be a Session instead of a generic Object
@stefanth stefanth Retrieve state processor when task is run instead of when enqueued.
Change PDUProcessTask so that state processor is retrieved when task is actually executed, not when task is enqueued. This solves a race condition where the bind state changes while a task is enqueued
@stefanth stefanth Fix race condition when session is being bound
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.
@stefanth stefanth Refactored EnquireLinkTimer thread into AbstractSession
There was duplicate code in SMPPSession and SMPPServerSession that should live in AbstractSession.
@stefanth stefanth Wait for EnquireLink thread to exit when closing
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
@stefanth stefanth Give EnquireLinkSender thread a name 3b5be56
@stefanth stefanth PDUReaderWorker waits for termination of executor service 6e80cf7
@stefanth stefanth Give PDUReaderWorker thread a name 022ca7d

That is nice... but what is the purpose of waiting termination...

The idea was that the PDUReaderWorker started the thread pool so it should make sure that it closes it before exiting. However, there is a missing link in the code because nobody is currently waiting for the PDUReaderWorkder to exit when the session is closed. The close method of the session should wait for the PDUReaderWorker to exit before the close method exits. I still haven't implemented how the close() method should wait for that temination so I don't have a commit for that.

@uudashr uudashr merged commit 75a2c16 into uudashr:master Feb 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.