smpp34 icon indicating copy to clipboard operation
smpp34 copied to clipboard

reconnect if the connection dropped

Open sidawymaher opened this issue 9 years ago • 1 comments

Hello, I am new to SMPP with golang. Can you please show how to reconnect if the connection dropped. Appreciate your feedback.

sidawymaher avatar Jul 03 '16 14:07 sidawymaher

@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.

ifiok avatar May 01 '18 12:05 ifiok