twitter-archive / cloudhopper-smpp

Efficient, scalable, and flexible Java implementation of the Short Messaging Peer to Peer Protocol (SMPP)
Other
382 stars 356 forks source link

Link SmppSession and SmppSessionHandler #110

Open pgoergler opened 9 years ago

pgoergler commented 9 years ago

Hello,

I have and DefaultSmppClient connected to an SMSC that delegate pdu received to an SmppSessionHandler. I would like to "qualify" those received Pdu with the SmppSession. ie: I would like to do in the SmppSessionHandler:

public PduResponse firePduRequestReceived(PduRequest pduRequest) {
    pduRequest.setFromSession(theSmppSession);
    // do some work
}

For a DefaultSmppServer, i have found how to do that, because there is a SmppSession.serverReady(SmppSessionHandler) method (which is called in the SmppServerHandler.sessionCreated())

But how can i do the same with a DefaultSmppClient ? It could be great if i can set the SmppSessionHandler after the creation of the session, but before the bind response was sent.

Maybe it could be usefull that SmppSessionHandle "knows" for which SmppSession it handles pdu ?