lib/connections, vendor: Change KCP mux to SMUX

Closes #4032
This commit is contained in:
Audrius Butkevicius
2017-03-09 14:01:07 +01:00
committed by Jakob Borg
parent f35e1ac0c5
commit ceea5ebeb3
22 changed files with 908 additions and 1889 deletions

View File

@@ -7,10 +7,9 @@
package connections
import (
"io/ioutil"
"time"
"github.com/hashicorp/yamux"
"github.com/xtaci/smux"
)
const (
@@ -25,12 +24,10 @@ const (
)
var (
yamuxConfig = &yamux.Config{
AcceptBacklog: 256,
EnableKeepAlive: true,
KeepAliveInterval: 30 * time.Second,
ConnectionWriteTimeout: 10 * time.Second,
MaxStreamWindowSize: 256 * 1024,
LogOutput: ioutil.Discard,
smuxConfig = &smux.Config{
KeepAliveInterval: 10 * time.Second,
KeepAliveTimeout: 30 * time.Second,
MaxFrameSize: 4096,
MaxReceiveBuffer: 4 * 1024 * 1024,
}
)