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.recv() panics when tcp read timeout #75

Open
myzhan opened this issue Nov 8, 2018 · 0 comments
Open

Socket.recv() panics when tcp read timeout #75

myzhan opened this issue Nov 8, 2018 · 0 comments

Comments

@myzhan
Copy link
Contributor

myzhan commented Nov 8, 2018

boomer is using gomq to pull message from master like this.

Sometimes I got a panic(index out of range) from inside gomq, generated by this line.

Then I print out msg.Err, it's read tcp i/o timeout.

func (s *Socket) Recv() ([]byte, error) {
	msg := <-s.recvChannel
	if msg.MessageType == zmtp.CommandMessage {
	}
	if msg.Err != nil {
		fmt.Printf("%v\n", msg.Err)
		return []byte(""), msg.Err
		// os.Exit(-1)
	}
	return msg.Body[0], msg.Err
}
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

1 participant