update go mod

This commit is contained in:
2024-08-18 17:23:52 +08:00
parent 48f630564f
commit 85803f75df
4 changed files with 41 additions and 21 deletions
+4 -5
View File
@@ -3,7 +3,6 @@ package notify
import (
"b612.me/starcrypto"
"b612.me/stario"
"b612.me/starnet"
"context"
"errors"
"fmt"
@@ -23,7 +22,7 @@ type ClientCommon struct {
conn net.Conn
mu sync.Mutex
msgID uint64
queue *starnet.StarQueue
queue *stario.StarQueue
stopFn context.CancelFunc
stopCtx context.Context
parallelNum int
@@ -55,7 +54,7 @@ func (c *ClientCommon) Connect(network string, addr string) error {
return errors.New("client already run")
}
c.stopCtx, c.stopFn = context.WithCancel(context.Background())
c.queue = starnet.NewQueueCtx(c.stopCtx, 4, math.MaxUint32)
c.queue = stario.NewQueueCtx(c.stopCtx, 4, math.MaxUint32)
conn, err := net.Dial(network, addr)
if err != nil {
return err
@@ -84,7 +83,7 @@ func (c *ClientCommon) ConnectTimeout(network string, addr string, timeout time.
return errors.New("client already run")
}
c.stopCtx, c.stopFn = context.WithCancel(context.Background())
c.queue = starnet.NewQueueCtx(c.stopCtx, 4, math.MaxUint32)
c.queue = stario.NewQueueCtx(c.stopCtx, 4, math.MaxUint32)
conn, err := net.DialTimeout(network, addr, timeout)
if err != nil {
return err
@@ -289,7 +288,7 @@ func (c *ClientCommon) loadMessage() {
continue
}
c.wg.Add(1)
go func(data starnet.MsgQueue) {
go func(data stario.MsgQueue) {
defer c.wg.Done()
//fmt.Println("c received:", float64(time.Now().UnixNano()-nowd)/1000000)
now := time.Now()