From cc77ae075dc7d98dc0f039565d6209070329ff26 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Tue, 10 Aug 2021 10:17:57 +0800 Subject: [PATCH] aa --- business/jxstore/tempop/tempop.go | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 1e3167734..abdeb8435 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -4,6 +4,8 @@ import ( "bytes" "context" "fmt" + "net" + "os" "regexp" "strings" "time" @@ -1970,9 +1972,32 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // } // } //} - cms.SetMTPSStatus2(0) + + server := "print.jxcs.net:8000" + tcpAddr, err := net.ResolveTCPAddr("tcp4", server) + if err != nil { + os.Exit(1) + return err + } + conn, err := net.DialTCP("tcp", nil, tcpAddr) + if err != nil { + return err + } + fmt.Println("result ,", connHandler(conn, "1e000f02000151323032313036313530303030313100000033")) return err } +func connHandler(c net.Conn, msg string) (result string) { + defer c.Close() + //缓冲 + buf := make([]byte, 1024) + //写入数据 + c.Write([]byte(msg)) + //服务器端返回的数据写入buf + n, _ := c.Read(buf) + result = string(buf[:n]) + //服务器端回传的信息 + return result +} func FreeBatchInfo2(name string, handler func(tasksch.ITask, []*jdapi.SkuIdEntity) (interface{}, int, error), ctx *jxcontext.Context, parentTask tasksch.ITask, storeSkuList []*jdapi.SkuIdEntity, batchSize int, isContinueWhenError bool) (resultList []interface{}, err error) { task := tasksch.NewParallelTask2(fmt.Sprintf("FreeBatchInfo:%s", name), tasksch.NewParallelConfig().SetParallelCount(1).SetBatchSize(batchSize).SetIsContinueWhenError(isContinueWhenError), ctx,