smpp34
smpp34 copied to clipboard
reconnect if the connection dropped
Hello, I am new to SMPP with golang. Can you please show how to reconnect if the connection dropped. Appreciate your feedback.
@sidawymaher The way I managed it is this:
defer func() { //catch or finally
if err := recover(); err != nil { //catch
fmt.Fprintf(os.Stderr, "Exception: %v\n", err)
app.Initialize(config)
}
}()
app.Initialize(config)
Where I intialize the bind in app.Initialize(config) and throw a panic whenever the connection drops.