Skip to content

Instantly share code, notes, and snippets.

@zeroFruit

zeroFruit/comm.go

Last active Oct 31, 2020
Embed
What would you like to do?
Modeling the Internet from the scratch: Link-layer, LAN, Switch - Code snippet: Network Adapter
package na
// Card is abstracted network adapter part to simulate bytes transport on
// physical cable. Node's interface uses this interface to send frame
// between nodes.
type Card interface {
Send(buf []byte, addr string) (time.Time, error)
Recv() <-chan *FrameData
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.