| | |
| | | // responses |
| | | SurveyTime time.Duration |
| | | // RecvDeadline is the time until the next recived of the SURVEY times out. |
| | | RecvDeadline time.Duration |
| | | //RecvDeadline time.Duration |
| | | // PollTime is minimal time between SURVEYS (The time between SURVEYS could be greater than this time |
| | | // if the SURVEY process takes longer than that time) |
| | | PollTime time.Duration |
| | |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | err = sock.SetOption(mangos.OptionRecvDeadline, opt.RecvDeadline) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | //err = sock.SetOption(mangos.OptionRecvDeadline, opt.RecvDeadline) |
| | | //if err != nil { |
| | | // return nil, err |
| | | //} |
| | | |
| | | pubCtx, pubCancel := context.WithCancel(ctx) |
| | | publisher, err = NewPublisher(pubCtx, urlPubSub) |
| | |
| | | for { |
| | | msg, err = d.sock.Recv() |
| | | if err != nil { |
| | | if err == mangos.ErrRecvTimeout { |
| | | if err == mangos.ErrProtoState { |
| | | // Timeout means I can add the current responses to the SET |
| | | d.services.Add(responses) |
| | | return |