|
@@ -576,7 +576,7 @@ func (h *Hub) ConnectToServer(channel string, force bool, host *HostInfo) (err e
|
|
|
}
|
|
|
if host == nil {
|
|
|
// 获取服务地址等信息
|
|
|
- host, err = h.connectHostFunc(channel, true)
|
|
|
+ host, err = h.connectHostFunc(channel, Both)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -713,7 +713,7 @@ func (h *Hub) ConnectToServer(channel string, force bool, host *HostInfo) (err e
|
|
|
// 重试方式连接服务
|
|
|
// 将会一直阻塞直到连接成功
|
|
|
func (h *Hub) ConnectToServerX(channel string, force bool) {
|
|
|
- host, _ := h.connectHostFunc(channel, false)
|
|
|
+ host, _ := h.connectHostFunc(channel, Direct)
|
|
|
for {
|
|
|
err := h.ConnectToServer(channel, force, host)
|
|
|
if err == nil {
|
|
@@ -739,7 +739,7 @@ func (h *Hub) checkProxyConnect() {
|
|
|
h.connects.Range(func(key, _ any) bool {
|
|
|
line := key.(*Line)
|
|
|
if line.host != nil && line.host.Proxy && now-line.updated.UnixMilli() > int64(h.cf.ProxyTimeout) {
|
|
|
- host, err := h.connectHostFunc(line.channel, false)
|
|
|
+ host, err := h.connectHostFunc(line.channel, Direct)
|
|
|
if err != nil {
|
|
|
log.Println("[checkProxyConnect connectHostFunc ERROR]", err)
|
|
|
return false
|