1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-31 06:26:53 -05:00

Increase conn keep-alive time

This commit is contained in:
Shelikhoo 2016-08-15 11:07:29 +08:00
parent d06c75f926
commit d250013c99
No known key found for this signature in database
GPG Key ID: 7791BDB0709ABD21

View File

@ -5,6 +5,7 @@ import (
"sync"
"time"
"github.com/v2ray/v2ray-core/common/log"
"github.com/v2ray/v2ray-core/common/signal"
)
@ -66,7 +67,7 @@ func (this *ConnectionCache) Recycle(dest string, conn *wsconn) {
aconn := &AwaitingConnection{
conn: conn,
expire: time.Now().Add(time.Second * 4),
expire: time.Now().Add(time.Second * 180),
}
var list []*AwaitingConnection
@ -108,5 +109,6 @@ func (this *ConnectionCache) Get(dest string) net.Conn {
res := list[firstValid].conn
list = list[firstValid+1:]
this.cache[dest] = list
log.Debug("WS:Conn Cache used.")
return res
}