Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct { In chan []byte Out chan []byte DestGone chan struct{} InCount, OutCount, LostCount uint64 // contains filtered or unexported fields }
Link represents a communication channel with a loss probability and a delay
func (*Link) ProcessPackets ¶
func (l *Link) ProcessPackets()
ProcessPackets listens the Input channel of the link until it is close and sends the incoming payload to a go routine DelayAndSend
type Node ¶
type Node struct { // Inputs and Outputs are the channels from which and to which the node // receives and sends payloads Inputs chan []byte InputsWg sync.WaitGroup InputsCount uint32 InputLinks []*Link OutputLinks []*Link // TTL is the time to live for a recoder Done chan struct{} ResetChan chan struct{} Encoder *kodo.Encoder Decoder *kodo.Decoder Data []byte NodeID byte RxPackets []uint32 Transmissions uint64 // contains filtered or unexported fields }
func NewDecoderNode ¶
func NewDecoderNode(factory *kodo.DecoderFactory, rate uint64) *Node
NewDecoderNode creates a node with a kodo Encoder. It takes an encoder factory as an argument, which it uses to create the encoder
func NewEncoderNode ¶
func NewEncoderNode(factory *kodo.EncoderFactory, rate uint64) *Node
NewEncoderNode creates a node with a kodo Encoder. It takes an encoder factory as an argument, which it uses to create the encoder
func NewRecoderNode ¶
func NewRecoderNode(factory *kodo.DecoderFactory, rate uint64) *Node
NewRecoderNode creates a node with a kodo Encoder. It takes an encoder factory as an argument, which it uses to create the encoder
func (*Node) ReceiveCodedPackets ¶
func (*Node) RecodeAndSend ¶
func (n *Node) RecodeAndSend()
func (*Node) Reset ¶
func (n *Node) Reset(factory *kodo.DecoderFactory)
func (*Node) SendEncodedPackets ¶
func (n *Node) SendEncodedPackets()
SendEncodedPackets produces encoded packets and sends them through all the output channels
func (*Node) SetConstSymbols ¶
func (n *Node) SetConstSymbols()
SetConstSymbols should be called after the n.Data slice have been filled with the desired data