BindRespEventHandler Not fired in version (1.1.21.5)

.NET library for SMPP protocol
Locked
syam
Posts: 5
Joined: Tue Feb 23, 2016 10:50 am

BindRespEventHandler Not fired in version (1.1.21.5)

Post by syam » Thu Mar 03, 2016 9:05 am

Dear Support,

This event was working with earlier version(1.0.12.0). but with with new version(1.1.21.5) it is not firing.

Code: Select all


objSMPP.evBindComplete += new Inetlab.SMPP.Common.BindRespEventHandler(client_evBindComplete);

void client_evBindComplete(object sender, Inetlab.SMPP.PDU.BindResp data)
        {
            try
            {
                int index = lstSMSCclientSMPP.IndexOf((SmppClient)sender);
                switch (data.Status)
                {
                    case CommandStatus.ESME_ROK:
                        lstSMPPConfig[index].Binded = true;
                        objLogger.log("Bind result " + index.ToString() + "[ " + lstSMPPConfig[index].ConnectionName + " ] : system is " + data.SystemId + " with status " + data.Status.ToString() + " Sequneceno " + data.Sequence.ToString(), "Connection");

                        ShortCodeAvailable_MT = objNpCustom.GetRouteAvailableforMT(lstSMPPConfig);
                        break;
                    default:
                        lstSMPPConfig[index].Binded = false;
                        objLogger.log("Bad status returned during Bind [ " + lstSMPPConfig[index].ConnectionName + " ]: " + data.Command.ToString() + " with status " + data.Status.ToString(), "Connection");
                        break;
                }
            }
            catch (Exception ex)
            {
                objLogger.log(ex.Message, "Error");
                objLogger.log(ex.ToString(), "Error");
            }
        }

alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: BindRespEventHandler Not fired in version (1.1.21.5)

Post by alt » Fri Mar 04, 2016 12:12 pm

Dear syam,

There are two methods to bind with server. Bind and BindAsync.

In asynchronous method BindAsync, BindResp should be received with the event evBindComplete.
In synchronous method Bind you can receive BindResp as return value therefore evBindComplete event is not firing.
Locked