Last active
October 31, 2020 12:18
-
-
Save zeroFruit/2d656cbd22edd627654e4419ce4f5251 to your computer and use it in GitHub Desktop.
Modeling the Internet from the scratch: Link-layer, LAN, Switch - Code snippet: Network Adapter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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