Lost of Connection
General Case
Lost of connection can be caused by :
- Router crash/reboot. Any of the routers along the route from one side to the other may crash or be rebooted; this causes a loss of connection if data is being sent at that time. If no data is being sent at that exact time, then the connection is not lost.
- Network cable is unplugged. Any network cables unplugged along the route from one side to the other will cause a loss of connection without any notification.
Lost of connection in Inetlab.SMPP library is detected within ENQUIRE_LINK request or when any other SMPP PDU is being sent. It can happen that a client detects disconnection earlier than a server. If the server is configured to allow only one connection for an SMPP account it may reject the subsequent bind requests by responding with BIND_RESP and status ESME_RALYBND. Once the server detects connection staled, it accepts the bind request again.
If you face such situation in your application you need to reconnect to the SMPP provider in 1-5 Minutes. Inetlab.SMPP library also provides connection recovery feature for SmppClient.
Also please be aware of SmppServer timeout settings.
SMPPCLIENT_NOCONN Status
The SmppResponse with status SMPPCLIENT_NOCONN comes after an unsuccessful attempt to send SMPP-command. Basically, it means there is no connection to the server. This may happen for the number of reasons (for example, if TLS versions do not match) and at various stages (before/after Connect, before/after Bind, during sending). If this is happening constantly and often, you should try to find what causes it in the first instance.
To continue normal operation, you should reestablish connection with the server and resend all SubmitSm with a new sequence number. The sequence number can be generated automatically when you set submtitSm.Header.Sequence = 0 or you can generate it manually with the code:
submitSm.Header.Sequence = _client.SequenceGenerator.NextSequenceNumber();