gomq
gomq copied to clipboard
Socket.recv() panics when tcp read timeout
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
}