|
|
@@ -8,6 +8,7 @@
|
|
|
package client
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
"mtp20access/packet"
|
|
|
"strconv"
|
|
|
)
|
|
|
@@ -63,6 +64,14 @@ func parseWareInfo(p *packet.MiQuotePacket) []wareInfo {
|
|
|
nPos2 = i + 1
|
|
|
}
|
|
|
if nPos1 >= 0 && nPos2 > 0 {
|
|
|
+ // 处理闪退问题
|
|
|
+ if nPos1 > nPos2 {
|
|
|
+ fmt.Printf("接收到错误的行情记录(nPos1>nPos2): %v \n", p.OriMsg)
|
|
|
+
|
|
|
+ // 重置nPos1, nPos2 继续查找下一个报价包
|
|
|
+ nPos1, nPos2 = -1, -1
|
|
|
+ }
|
|
|
+
|
|
|
v := wareInfo{buf: data[nPos1:nPos2]}
|
|
|
v.parseField()
|
|
|
//v.printInfo()
|