Skip to content

Commit

Permalink
change FEC queue settings
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Nov 18, 2016
1 parent 3f35e45 commit 2a9a3f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sess.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
cryptHeaderSize = nonceSize + crcSize
mtuLimit = 2048
txQueueLimit = 8192
rxFecLimit = 8192
rxFECMulti = 3 // FEC keeps rxFECMulti* (dataShard+parityShard) ordered packets in memory
defaultKeepAliveInterval = 10 * time.Second
)

Expand Down Expand Up @@ -95,7 +95,7 @@ func newUDPSession(conv uint32, dataShards, parityShards int, l *Listener, conn
sess.keepAliveInterval = defaultKeepAliveInterval
sess.l = l
sess.block = block
sess.fec = newFEC(rxFecLimit, dataShards, parityShards)
sess.fec = newFEC(rxFECMulti*(dataShards+parityShards), dataShards, parityShards)
// calculate header size
if sess.block != nil {
sess.headerSize += cryptHeaderSize
Expand Down Expand Up @@ -869,7 +869,7 @@ func ServeConn(block BlockCrypt, dataShards, parityShards int, conn net.PacketCo
l.dataShards = dataShards
l.parityShards = parityShards
l.block = block
l.fec = newFEC(rxFecLimit, dataShards, parityShards)
l.fec = newFEC(rxFECMulti*(dataShards+parityShards), dataShards, parityShards)
l.rxbuf.New = func() interface{} {
return make([]byte, mtuLimit)
}
Expand Down

0 comments on commit 2a9a3f7

Please sign in to comment.