|
@@ -36,6 +36,7 @@ func main() {
|
|
|
udpclient = mu.UdpClient{Local: udpPort, BufSize: 1024}
|
|
|
udpclient.Listen(ProcessUdpMsg)
|
|
|
log.Println("Udp服务监听", g.Config().MustGet(ctx, "udpPort").String())
|
|
|
+ go repair()
|
|
|
//service.IncDataById("684a9c215f834436f09c2710", "684a9c215f834436f09c2710")
|
|
|
//service.Tj()
|
|
|
//service.Hz()
|
|
@@ -54,12 +55,10 @@ func ProcessUdpMsg(act byte, data []byte, ra *net.UDPAddr) {
|
|
|
if err != nil {
|
|
|
udpclient.WriteUdp([]byte("err:"+err.Error()), mu.OP_NOOP, ra)
|
|
|
} else if mapInfo != nil {
|
|
|
+ go udpclient.WriteUdp([]byte(qu.ObjToString(mapInfo["key"])), mu.OP_NOOP, ra)
|
|
|
log.Println("接收到udp消息", string(data))
|
|
|
- stype := qu.ObjToString(mapInfo["stype"])
|
|
|
sid, eid := qu.ObjToString(mapInfo["gtid"]), qu.ObjToString(mapInfo["lteid"])
|
|
|
- key := sid + "-" + eid + "-" + stype
|
|
|
- go udpclient.WriteUdp([]byte(key), mu.OP_NOOP, ra)
|
|
|
- if stype == "bidding" {
|
|
|
+ if qu.ObjToString(mapInfo["stype"]) == "bidding" {
|
|
|
lock.Lock()
|
|
|
service.IncDataById(sid, eid)
|
|
|
sendNextNode(nil, sid, eid)
|
|
@@ -99,3 +98,7 @@ func sendNextNode(by []byte, sid string, eid string) {
|
|
|
}
|
|
|
udpclient.WriteUdp(by, mu.OP_TYPE_DATA, addr) //发送下节点
|
|
|
}
|
|
|
+
|
|
|
+func repair() {
|
|
|
+
|
|
|
+}
|