Skip to content

Commit 6bb2d84

Browse files
authored
refactor: update connection retrieval methods in common TCP and common UDP
1 parent 59f77d2 commit 6bb2d84

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/common.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ func (c *Common) commonTCPLoop() {
796796
defer c.releaseSlot(false)
797797

798798
// 从连接池获取连接
799-
id, remoteConn, err := c.tunnelPool.ServerGet(poolGetTimeout)
799+
id, remoteConn, err := c.tunnelPool.IncomingGet(poolGetTimeout)
800800
if err != nil {
801801
c.logger.Warn("commonTCPLoop: request timeout: %v", err)
802802
return
@@ -896,7 +896,7 @@ func (c *Common) commonUDPLoop() {
896896
}
897897

898898
// 获取池连接
899-
id, remoteConn, err = c.tunnelPool.ServerGet(poolGetTimeout)
899+
id, remoteConn, err = c.tunnelPool.IncomingGet(poolGetTimeout)
900900
if err != nil {
901901
c.logger.Warn("commonUDPLoop: request timeout: %v", err)
902902
c.releaseSlot(true)
@@ -1089,7 +1089,7 @@ func (c *Common) commonTCPOnce(signalURL *url.URL) {
10891089
c.logger.Debug("TCP launch signal: cid %v <- %v", id, c.tunnelTCPConn.RemoteAddr())
10901090

10911091
// 从连接池获取连接
1092-
remoteConn, err := c.tunnelPool.ClientGet(id, poolGetTimeout)
1092+
remoteConn, err := c.tunnelPool.OutgoingGet(id, poolGetTimeout)
10931093
if err != nil {
10941094
c.logger.Error("commonTCPOnce: request timeout: %v", err)
10951095
c.tunnelPool.AddError()
@@ -1166,7 +1166,7 @@ func (c *Common) commonUDPOnce(signalURL *url.URL) {
11661166
c.logger.Debug("UDP launch signal: cid %v <- %v", id, c.tunnelTCPConn.RemoteAddr())
11671167

11681168
// 获取池连接
1169-
remoteConn, err := c.tunnelPool.ClientGet(id, poolGetTimeout)
1169+
remoteConn, err := c.tunnelPool.OutgoingGet(id, poolGetTimeout)
11701170
if err != nil {
11711171
c.logger.Error("commonUDPOnce: request timeout: %v", err)
11721172
c.tunnelPool.AddError()

0 commit comments

Comments
 (0)