exchange

package
v0.0.0-...-f2d3015 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateInvalid = iota
	StateConnecting
	StateHandshaking
	StateOperating
)
View Source
const DetailedDebug = false
View Source
const (
	MaxOutstandingTokens = 10
)

Variables

This section is empty.

Functions

func FakeWire

func FakeWire(ctx model.SimContext, lsink model.DataSinkBytes, lsource model.DataSourceBytes, psink fwmodel.PacketSink, psource fwmodel.PacketSource, label string)

Types

type Exchange

type Exchange struct {
	Sim   model.SimContext
	Label string

	State ExchangeState

	SendHandshakeId        uint32
	RecvHandshakeId        uint32
	SendSecondaryHandshake bool

	FctsSent uint32
	FctsRcvd uint32
	PktsSent uint32
	PktsRcvd uint32

	InboundBuffer  []byte
	InboundPending [][]byte
	RecvInProgress bool

	CondNotify *component.EventDispatcher

	TxBusy bool
}

func (*Exchange) CheckInvariants

func (ex *Exchange) CheckInvariants()

func (*Exchange) Debug

func (ex *Exchange) Debug(explanation string, args ...interface{})

func (*Exchange) HandshakePeriod

func (ex *Exchange) HandshakePeriod() time.Duration

HandshakePeriod generates a random interval in the range [5ms, 15ms)

func (*Exchange) ReceiveBytes

func (ex *Exchange) ReceiveBytes(bytes []byte)

func (*Exchange) ReceiveCtrlChar

func (ex *Exchange) ReceiveCtrlChar(symbol codec.ControlChar, param uint32)

func (*Exchange) Reset

func (ex *Exchange) Reset()

func (*Exchange) Transmit

func (ex *Exchange) Transmit(io *component.TwixtIO, sink model.DataSinkBytes, data []byte)

Transmit requires that TxBusy is false.

type ExchangeState

type ExchangeState uint8

func (ExchangeState) String

func (s ExchangeState) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL