diff --git a/client.go b/client.go index 9bf9385..0babd43 100644 --- a/client.go +++ b/client.go @@ -1,6 +1,7 @@ package tdx import ( + "encoding/hex" "github.com/injoyai/base/maps/wait/v2" "github.com/injoyai/conv" "github.com/injoyai/ios" @@ -88,6 +89,7 @@ func (this *Client) Connect() error { } // GetSecurityList 获取市场内指定范围内的所有证券代码 +// 0c02000000011a001a003e05050000000000000002000030303030303101363030303038 func (this *Client) GetSecurityList() (*protocol.SecurityListResp, error) { f := protocol.Frame{ @@ -95,8 +97,14 @@ func (this *Client) GetSecurityList() (*protocol.SecurityListResp, error) { Type: protocol.Connect, Data: nil, } + _ = f - _, err := this.Write(f.Bytes()) + bs, err := hex.DecodeString("0c02000000011a001a003e05050000000000000002000030303030303101363030303038") + if err != nil { + return nil, err + } + + _, err = this.Write(bs) return nil, err } diff --git a/example/test/main.go b/example/test/main.go index 2a0a967..dbcc554 100644 --- a/example/test/main.go +++ b/example/test/main.go @@ -3,7 +3,6 @@ package main import ( "bytes" "encoding/binary" - "encoding/hex" "github.com/injoyai/goutil/g" "github.com/injoyai/ios/client" "github.com/injoyai/ios/server" @@ -27,9 +26,7 @@ func main() { b1cb74001c00000000000d005100bd00789c6378c1cecb252ace6066c5b4898987b9050ed1f90cc5b74c18a5bc18c1b43490fecff09c81819191f13fc3c9f3bb169f5e7dfefeb5ef57f7199a305009308208e5b32bb6bcbf70148712002d7f1e13 b1cb74000c02000000003e05ac00ac000102020000303030303031601294121a1c2d4eadabcf0ed412aae5fc01afb0024561124fbcc08301afa47900b2e3174100bf68871a4201b741b6144302bb09af334403972e96354504ac09b619560e00000000f8ff601201363030303038b60fba04060607429788a70efa04ada37ab2531c12974d91e7449dbc354184b6010001844bad324102b5679ea1014203a65abd8d0143048a6ba4dd01440587e101b3d2029613000000000000b60f */ - bs, err := hex.DecodeString("0c02000000011a001a003e05050000000000000002000030303030303101363030303038") - logs.PanicErr(err) - _, err = c.Write(bs) + _, err = c.GetSecurityList() logs.PanicErr(err) select {}