| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Network.Control
Description
Common parts to control network protocols.
Synopsis
- defaultMaxStreams :: Int
- defaultMaxStreamData :: Int
- defaultMaxData :: Int
- data TxFlow = TxFlow {}
- newTxFlow :: WindowSize -> TxFlow
- txWindowSize :: TxFlow -> WindowSize
- type WindowSize = Int
- data RxFlow = RxFlow {
- rxfWindow :: WindowSize
- rxfConsumed :: Int
- rxfReceived :: Int
- rxfLimit :: Int
- newRxFlow :: WindowSize -> RxFlow
- data FlowControlType
- maybeOpenRxWindow :: Int -> FlowControlType -> RxFlow -> (RxFlow, Maybe Int)
- checkRxLimit :: Int -> RxFlow -> (RxFlow, Bool)
- data LRUCache k v
- empty :: Int -> LRUCache k v
- insert :: Ord k => k -> v -> LRUCache k v -> LRUCache k v
- delete :: Ord k => k -> LRUCache k v -> LRUCache k v
- lookup :: Ord k => k -> LRUCache k v -> Maybe v
- data Rate
- newRate :: IO Rate
- getRate :: Rate -> IO Int
- addRate :: Rate -> Int -> IO Int
Constants for flow control.
defaultMaxStreams :: Int Source #
Default max streams. (64)
defaultMaxStreamData :: Int Source #
Default max data of a stream. (256K bytes)
defaultMaxData :: Int Source #
Default max data of a connection. (1M bytes)
Flow control for sending
Flow for sending
newTxFlow :: WindowSize -> TxFlow Source #
Creating TX flow with an initial window size.
txWindowSize :: TxFlow -> WindowSize Source #
type WindowSize = Int Source #
Window size.
Flow control for receiving
Flow for receiving
Constructors
| RxFlow | |
Fields
| |
newRxFlow :: WindowSize -> RxFlow Source #
Creating RX flow with an initial window size.
data FlowControlType Source #
The representation of window size update.
Constructors
| FCTWindowUpdate | HTTP/2 style |
| FCTMaxData | QUIC style |
Arguments
| :: Int | The consumed size. |
| -> FlowControlType | |
| -> RxFlow | |
| -> (RxFlow, Maybe Int) |
|
When an application consumed received data,
this function should be called to update rxfConsumed.
If the window size is less than the half of the initial window.
the representation of window size update is returned.
Checking if received data is acceptable against the current window.