mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-29 23:34:44 +00:00
configuration for connection reuse
This commit is contained in:
1 parent
6ce7b1d532
commit
a86cd36ad2
9 files changed
+124
-7
No files matched your search
@@ -3,6 +3,8 @@ package hub
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/v2ray/v2ray-core/transport"
|
||||
)
|
||||
|
||||
type ConnectionHandler func(*Connection)
|
||||
@@ -37,7 +39,7 @@ func (this *Connection) Close() error {
|
||||
if this == nil || this.conn == nil {
|
||||
return ErrorClosedConnection
|
||||
}
|
||||
if this.Reusable() {
|
||||
if transport.TCPStreamConfig.ConnectionReuse && this.Reusable() {
|
||||
this.listener.Recycle(this.dest, this.conn)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user