Created
November 25, 2015 04:51
-
-
Save olegfedoseev/3931d9460fb890db8c68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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