Skip to content

Instantly share code, notes, and snippets.

@olegfedoseev
Created November 25, 2015 04:51
Show Gist options
  • Save olegfedoseev/3931d9460fb890db8c68 to your computer and use it in GitHub Desktop.
Save olegfedoseev/3931d9460fb890db8c68 to your computer and use it in GitHub Desktop.
package main
import (
zmq "github.com/pebbe/zmq4"
"log"
)
func main() {
subscriber, _ := zmq.NewSocket(zmq.SUB)
subscriber.Connect("localhost:1234")
defer subscriber.Close()
for {
msg, err := subscriber.RecvMessage(0)
if err != nil {
log.Printf("Failed to recive message: %v", err)
break
}
log.Printf("Msg: %v", msg)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment