| | |
| | | if err != nil { |
| | | logger.Error("创建请求socket失败: %s", err.Error()) |
| | | } |
| | | serverIP, _ := GetLocalIP() |
| | | if err = sock.Dial("tcp://"+serverIP+":4010"); err != nil { |
| | | logger.Error("请求socket拨号失败: %s", err.Error()) |
| | | } |
| | | } |
| | | |
| | | type BaseInfo struct { |
| | |
| | | // 给目标填充liker |
| | | func (arg *Arg) fillLiker(tableId []string, compareThreshold float32) { |
| | | //bytes := bigCache.GetComparePersonBaseInfo(tableId, arg.Feature, compareThreshold) |
| | | //comArg := &protomsg.CompareArgs{ |
| | | // TableIds:tableId, |
| | | // FaceFeature:arg.Feature, |
| | | // CompareThreshold:compareThreshold, |
| | | // Source:false, |
| | | //} |
| | | //serverIp, _ := GetLocalIP() |
| | | //bytes := Push("tcp://"+serverIp+":4010",comArg,sock) |
| | | bytes := []byte{} |
| | | comArg := &protomsg.CompareArgs{ |
| | | TableIds:tableId, |
| | | FaceFeature:arg.Feature, |
| | | CompareThreshold:compareThreshold, |
| | | Source:false, |
| | | } |
| | | |
| | | bytes := Push(comArg,sock) |
| | | //bytes := []byte{} |
| | | var scResult protomsg.SdkCompareResult |
| | | err1 := proto.Unmarshal(bytes, &scResult) |
| | | if err1 != nil { |
| | |
| | | } |
| | | } |
| | | |
| | | func Push(url string,data *protomsg.CompareArgs,sock mangos.Socket) []byte{ |
| | | func Push(data *protomsg.CompareArgs,sock mangos.Socket) []byte{ |
| | | //var sock mangos.Socket |
| | | var err error |
| | | var msg []byte |
| | |
| | | } |
| | | //sock.AddTransport(ipc.NewTransport()) |
| | | sock.AddTransport(tcp.NewTransport()) |
| | | if err = sock.Dial(url); err != nil { |
| | | logger.Error("请求socket拨号失败: %s", err.Error()) |
| | | } |
| | | |
| | | logger.Info("序列化数据") |
| | | bytes,err1 := proto.Marshal(data) |
| | | logger.Info("数据长度为:",len(bytes)) |