Example #1
0
// SetId sets simple random printable identity on socket
func SetId(socket *zmq.Socket) {
	buf := make([]byte, 4)
	io.ReadFull(rand.Reader, buf)
	id := fmt.Sprintf("%04X-%04X", buf[:2], buf[2:])
	socket.SetIdentitiy([]byte(id))
}