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

CloseAndReconnect() only Close but doesn't Reconnect #41

Open
ZhangHanming opened this issue Jun 30, 2021 · 6 comments
Open

CloseAndReconnect() only Close but doesn't Reconnect #41

ZhangHanming opened this issue Jun 30, 2021 · 6 comments

Comments

@ZhangHanming
Copy link

// CloseAndReconnect will try to reconnect.
func (rc *RecConn) CloseAndReconnect() {
	rc.Close()
	go rc.connect()
}

the Close() function send to the close chan

rc.close <- true

connect() will return if it receives from close chan

func (rc *RecConn) connect() {
	b := rc.getBackoff()
	rand.Seed(time.Now().UTC().UnixNano())

	for {
		select {
		case <-rc.close:
			return
....

in the end calling connect() right after Close() will not work.

Am I missing something here or it is a bug?

@ZhangHanming
Copy link
Author

@loeffel-io Hi is this repo still actively maintained?

@masseelch
Copy link

My issue is open for more than half a year without any reaction. This repo is dead I guess :sad:

@loeffel-io
Copy link
Member

hey guys, its not dead - just have no time for it rn - PRs are welcome :-)

@masseelch
Copy link

hey guys, its not dead - just have no time for it rn - PRs are welcome :-)

Glad to hear :-)

@ZhangHanming
Copy link
Author

hey guys, its not dead - just have no time for it rn - PRs are welcome :-)

@loeffel-io Hi Please verify if the stated behaviour is possible at least. Then people can work around it before a fix. thank you

@loeffel-io
Copy link
Member

Please see #61

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

3 participants