module Network.QUIC.Recovery.Constants where
import Network.QUIC.Connector
import Network.QUIC.Imports
import Network.QUIC.Recovery.Types
import Network.QUIC.Types
timerGranularity :: Microseconds
timerGranularity :: Microseconds
timerGranularity = Int -> Microseconds
Microseconds Int
10000
kPacketThreshold :: PacketNumber
kPacketThreshold :: Int
kPacketThreshold = Int
3
kTimeThreshold :: Microseconds -> Microseconds
kTimeThreshold :: Microseconds -> Microseconds
kTimeThreshold Microseconds
x = Microseconds
x forall a. Num a => a -> a -> a
+ (Microseconds
x forall a. Bits a => a -> Int -> a
!>>. Int
3)
kGranularity :: Microseconds
kGranularity :: Microseconds
kGranularity = Microseconds
timerGranularity forall a. Num a => a -> a -> a
* Microseconds
2
kInitialWindow :: Int -> Int
kInitialWindow :: Int -> Int
kInitialWindow Int
pktSiz = Int
pktSiz forall a. Bits a => a -> Int -> a
!<<. Int
2
kMinimumWindow :: LDCC -> IO Int
kMinimumWindow :: LDCC -> IO Int
kMinimumWindow LDCC
ldcc = do
Int
siz <- forall a. Connector a => a -> IO Int
getMaxPacketSize LDCC
ldcc
forall (m :: * -> *) a. Monad m => a -> m a
return (Int
siz forall a. Bits a => a -> Int -> a
!<<. Int
2)
kLossReductionFactor :: Int -> Int
kLossReductionFactor :: Int -> Int
kLossReductionFactor = (forall a. Bits a => a -> Int -> a
!>>. Int
1)
kPersistentCongestionThreshold :: Microseconds -> Microseconds
kPersistentCongestionThreshold :: Microseconds -> Microseconds
kPersistentCongestionThreshold (Microseconds Int
us) = Int -> Microseconds
Microseconds (Int
3 forall a. Num a => a -> a -> a
* Int
us)