示例#1
0
文件: imp.go 项目: CaptainSoOmA/Uni
func (x *Imp) Go(me uint) {
	//
	ego := fmon.New0(x.object, 1, x.f, TrueSp, x.host[me], x.port[me])
	go ego.Go()
	//  go fmon.New (x.object, 1, x.f, TrueSp, x.host[me], x.port[me]) // TODO
	for i := uint(0); i < x.n; i++ {
		x.mon[i].Go()
	}
}
示例#2
0
文件: imp.go 项目: CaptainSoOmA/Uni
func New(host []string, port []uint, nb []uint, f FuncSpectrum, a Any) *Imp {
	//
	x := new(Imp)
	x.host, x.port, x.h = host, port, uint(len(host))
	x.nb, x.n = nb, uint(len(nb))
	x.mon = make([]*fmon.Imp, x.n)
	x.f = f
	x.object = Clone(a)
	for i := uint(0); i < x.n; i++ {
		x.mon[i] = fmon.New0(x.object, 1, NilSp, TrueSp, x.host[x.nb[i]], x.port[x.nb[i]])
	}
	return x
}