Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reconnect if the connection dropped #16

Open
sidawymaher opened this issue Jul 3, 2016 · 1 comment
Open

reconnect if the connection dropped #16

sidawymaher opened this issue Jul 3, 2016 · 1 comment

Comments

@sidawymaher
Copy link

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

@ifiok
Copy link
Contributor

ifiok commented May 1, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants