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

socket中有个错误 #7

Closed
kekemuyu opened this issue Dec 15, 2016 · 1 comment
Closed

socket中有个错误 #7

kekemuyu opened this issue Dec 15, 2016 · 1 comment

Comments

@kekemuyu
Copy link

kekemuyu commented Dec 15, 2016

`连不上
if err != nil {

		if self.tryConnTimes <= reportConnectFailedLimitTimes {
			log.Errorf("#connect failed(%s) %v", self.name, err.Error())
		}

		if self.tryConnTimes == reportConnectFailedLimitTimes {
			log.Errorf("(%s) continue reconnecting, but mute log", self.name)
		}

		// 没重连就退出
		if self.autoReconnectSec == 0 {
			break
		}

		// 有重连就等待
		time.Sleep(time.Duration(self.autoReconnectSec) * time.Second)

		// 继续连接
		continue
	}`

if self.tryConnTimes <= reportConnectFailedLimitTimes应该是>=吧

@davyxu
Copy link
Owner

davyxu commented Dec 15, 2016

这句的逻辑是, 在reportConnectFailedLimitTimes 内我会每次打印错误日志. 超过次数, self.tryConnTimes == reportConnectFailedLimitTimes 这句, 告诉你, 重连还在继续, 但是不打日志. 避免刷日志的问题

重连不上是你其他地方的问题, 请自查下

@davyxu davyxu closed this as completed Jan 18, 2017
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