Skip to content

Commit

Permalink
Merge pull request #12 from vyzo/feat/write-coalesce-delay
Browse files Browse the repository at this point in the history
copy default config to account for new struct members
  • Loading branch information
Stebalien authored May 21, 2019
2 parents 444e14b + 7a70e76 commit aaa6b59
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions p2p/muxer/yamux/yamux.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ func (c *conn) AcceptStream() (smux.Stream, error) {
// yamux-backed connections.
type Transport yamux.Config

// DefaultTransport has default settings for yamux
var DefaultTransport = (*Transport)(&yamux.Config{
AcceptBacklog: 256, // from yamux.DefaultConfig
EnableKeepAlive: true, // from yamux.DefaultConfig
KeepAliveInterval: 30 * time.Second, // from yamux.DefaultConfig
ConnectionWriteTimeout: 10 * time.Second, // from yamux.DefaultConfig
var DefaultTransport *Transport

func init() {
config := yamux.DefaultConfig()
// We've bumped this to 16MiB as this critically limits throughput.
//
// 1MiB means a best case of 10MiB/s (83.89Mbps) on a connection with
// 100ms latency. The default gave us 2.4MiB *best case* which was
// totally unacceptable.
MaxStreamWindowSize: uint32(16 * 1024 * 1024),
LogOutput: ioutil.Discard,
})
config.MaxStreamWindowSize = uint32(16 * 1024 * 1024)
// don't spam
config.LogOutput = ioutil.Discard
DefaultTransport = (*Transport)(config)
}

func (t *Transport) NewConn(nc net.Conn, isServer bool) (smux.Conn, error) {
var s *yamux.Session
Expand Down

0 comments on commit aaa6b59

Please sign in to comment.