Documentation ¶
Index ¶
Constants ¶
View Source
const ( Raw = iota Ack Wit Catchup )
View Source
const ChanLen = 500
Variables ¶
View Source
var Logger1 *log.Logger
Functions ¶
This section is empty.
Types ¶
type CommunicationInterface ¶
type CommunicationInterface interface { Send([]byte, int) // Send a message to a specific node Broadcast([]byte) // Broadcast messages to other nodes Receive() *[]byte // Blocking receive Disconnect() // Disconnect node Reconnect(string) // Reconnect node BroadcastMsg(message Message) }
CommunicationInterface is a interface used for communicating with transport layer.
type MessageInterface ¶
type Node ¶
type Node struct { Id int // Id of the node TimeStep int // Node's local time step ThresholdAck int // Threshold on number of messages ThresholdWit int // Threshold on number of witnessed messages Acks int // Number of acknowledges Wits int // Number of witnesses Comm CommunicationInterface // interface for communicating with other nodes ConvertMsg MessageInterface CurrentMsg Message // Message which the node is waiting for acks History []Message // History of received messages by a node }
Node is the struct used for keeping everything related to a node in TLC.
func (*Node) Advance ¶
Advance will change the step of the node to a new one and then broadcast a message to the network.
func (*Node) WaitForMsg ¶
waitForMsg waits for upcoming messages and then decides the next action with respect to msg's contents.
Click to show internal directories.
Click to hide internal directories.