configuration for connection reuse

This commit is contained in:
v2ray committed 2016-06-02 01:49:25 +02:00
1 parent 6ce7b1d532
commit a86cd36ad2
9 files changed
+124 -7

No files matched your search

+3 -1
View File
@@ -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
}