Connection recovery
Connection recovery can be activated with ConnectionRecovery property.
SmppClient _client = new SmppClient();
_client.ConnectionRecovery = true;
This works only after first successful bind. SmppClient triggers following events by connection recovery:
- event evRecoverySucceeded - when bind was successful.
- event evDisconnected - when bind was failed.
Connection won't be recovered when you call directly the method client.Disconnect().
For the first successful bind you need to write a Connect method that repeats Connect and Bind until the status ESME_ROK in BindResp is received. The extension method RetryUntilBindAsync(SmppClient, SmppClientConnectionOptions, string, string, TimeSpan, ConnectionMode, int, CancellationToken) can help you.
The delay time between recovery attempts can be changed with the property ConnectionRecoveryDelay. Default is 2 minutes.