hans-2.4.0.0: IPv4 Network Stack

Safe HaskellNone
LanguageHaskell98

Hans.Layer.Tcp.Types

Synopsis

Documentation

type TimeWaitConnections = Map SocketId TimeWaitSock Source

The socket that's in TimeWait, plus its current 2MSL value.

data TimeWaitSock Source

Constructors

TimeWaitSock 

Fields

tw2MSL :: !SlowTicks

The current 2MSL value

twInit2MSL :: !SlowTicks

The initial 2MSL value

twSeqNum :: !TcpSeqNum

The sequence number to use when responding to messages

twTimestamp :: Maybe Timestamp

The last timestamp used

Instances

addTimeWait :: TcpSocket -> TimeWaitConnections -> TimeWaitConnections Source

Add a socket to the TimeWait map.

stepTimeWaitConnections :: TimeWaitConnections -> TimeWaitConnections Source

Take one step, collecting any connections whose 2MSL timer goes to 0.

mslTimeout :: SlowTicks Source

MSL is 60 seconds, which is slightly more aggressive than the 2 minutes from the original RFC.

data Timestamp Source

Manage the timestamp values that are in flight between two hosts.

Instances

stepTimestamp :: POSIXTime -> Timestamp -> Timestamp Source

Update the timestamp value, advancing based on the timestamp granularity. If the number of ticks to advance is 0, don't advance the timestamp.

mkTimestamp :: Timestamp -> TcpOption Source

Generate timestamp option for an outgoing packet.

type Acceptor = SocketId -> IO () Source

type Notify = Bool -> IO () Source

type Close = IO () Source