mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
优化,服务地址可不填端口
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/injoyai/logs"
|
"github.com/injoyai/logs"
|
||||||
"github.com/injoyai/tdx/protocol"
|
"github.com/injoyai/tdx/protocol"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
|
"strings"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -32,6 +33,9 @@ func WithRedial(b ...bool) client.Option {
|
|||||||
|
|
||||||
// Dial 与服务器建立连接
|
// Dial 与服务器建立连接
|
||||||
func Dial(addr string, op ...client.Option) (cli *Client, err error) {
|
func Dial(addr string, op ...client.Option) (cli *Client, err error) {
|
||||||
|
if !strings.Contains(addr, ":") {
|
||||||
|
addr += ":7709"
|
||||||
|
}
|
||||||
|
|
||||||
cli = &Client{
|
cli = &Client{
|
||||||
Wait: wait.New(time.Second * 2),
|
Wait: wait.New(time.Second * 2),
|
||||||
|
|||||||
Reference in New Issue
Block a user