/****************************************************************************** * 概述: 判断并创建一个新的sds socket * 函数名: insertSocket * 返回值: * 参数列表: 参数名 参数类型 取值范围 描述 * pp *dzhyun.SDSEndpoint * *******************************************************************************/ func (this *DataCache) insertSocket(pp *dzhyun.SDSEndpoint) { if pp == nil || pp.GetBusiPath() != DEFAULT_SdsServicepath { return } this.msocMutex.Lock() defer this.msocMutex.Unlock() if _, ok := this.mSocketGroup[(*pp).GetNodeName()]; !ok { newZmqSocket := &ZmqSocket{} if reqUrl, subUrl, err := this.getSdsAddr((*pp).GetInterface()); err == nil { this.msocketSerial++ if err := newZmqSocket.Init(reqUrl, subUrl, this.mzmq, this.msocketSerial, this.mSocketsStateCh); err == nil { this.mSocketGroup[(*pp).GetNodeName()] = newZmqSocket log4.Debug("insertSocket size=%d nodename=%s %s %s", len(this.mSocketGroup), (*pp).GetNodeName(), reqUrl, subUrl) } } } }