Skip to content

Instantly share code, notes, and snippets.

@tylertreat
Created January 10, 2015 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tylertreat/e20a1f4c9ec0b384614a to your computer and use it in GitHub Desktop.
Save tylertreat/e20a1f4c9ec0b384614a to your computer and use it in GitHub Desktop.
survey, _ = surveyor.NewSocket()
survey.AddTransport(tcp.NewTransport())
survey.Listen("tcp://:8000")
survey.SetOption(mangos.OptionSurveyTime, time.Second)
for {
survey.Send("Is anybody out there?")
for {
if msg, err = survey.Recv(); err != nil {
break
}
fmt.Printf("Discovered: %s\n", string(msg))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment