예제 #1
0
파일: tel.go 프로젝트: fedgrant/tonika
func (d *Dialer0) Add(auth sys.AuthRemote, addr string) {
	d.lk.Lock()
	_, present := d.tels[*auth.GetId()]
	d.lk.Unlock()
	if present {
		return
	}
	t := makeTel(d, auth, addr)
	d.lk.Lock()
	d.tels[*auth.GetId()] = t
	d.dials[*auth.GetAcceptKey()] = t
	d.lk.Unlock()
	t.rebalance()
}