zhou.xiaoning 2 éve
szülő
commit
1a0e9001d6
2 módosított fájl, 8 hozzáadás és 0 törlés
  1. 6 0
      client/wareInfo.go
  2. 2 0
      quote_publish/quote_publish.go

+ 6 - 0
client/wareInfo.go

@@ -7,6 +7,8 @@
 
 package client
 
+import "fmt"
+
 type wareInfo struct {
 	buf       []byte // 内容[报价开始(0x10):报价结束(0x11)]
 	exchId    string // 交易所id
@@ -18,10 +20,14 @@ type wareInfo struct {
 }
 
 func (r *wareInfo) getField(tag byte) string {
+	fmt.Printf("getField ----------------------- %v \n", tag)
+	fmt.Printf("r.buf(%v): %v \n", len(r.buf), r.buf)
+
 	for i, v := range r.buf {
 		if v == tag {
 			for j, d := range r.buf[i:] {
 				if d == 0x01 || d == 0x11 {
+					fmt.Printf("i:%v j:%v \n", i, j)
 					buf := r.buf[i+2 : i+j]
 					return string(buf)
 				}

+ 2 - 0
quote_publish/quote_publish.go

@@ -1,6 +1,7 @@
 package quote_publish
 
 import (
+	"fmt"
 	"mtp20access/global"
 	"mtp20access/packet"
 	"mtp20access/publish"
@@ -82,6 +83,7 @@ func (r *QuotePublish) readQuote() {
 			continue
 		}
 
+		fmt.Println(p.OriMsg)
 		// 分发给订阅者
 		global.M2A_Publish.Publish(publish.Topic_Quote, &p)
 	}