优化,服务地址可不填端口

This commit is contained in:
injoyai
2024-10-31 08:35:23 +08:00
parent 5b22791bff
commit 0939f69398

View File

@@ -12,6 +12,7 @@ import (
"github.com/injoyai/logs"
"github.com/injoyai/tdx/protocol"
"runtime/debug"
"strings"
"sync/atomic"
"time"
)
@@ -32,6 +33,9 @@ func WithRedial(b ...bool) client.Option {
// Dial 与服务器建立连接
func Dial(addr string, op ...client.Option) (cli *Client, err error) {
if !strings.Contains(addr, ":") {
addr += ":7709"
}
cli = &Client{
Wait: wait.New(time.Second * 2),