Project 1 - Peer-to-peer and interface protocols using C
1.0
A half-duplex layered communication system.
|
Layer 1 maintains byte ordering such that the receiver receives the first byte sent before receiving the second byte, etc. More...
#include "layer.h"
Functions | |
int | layer1_write (char b) |
Sample layer1_write just calls write to stdout. More... | |
int | layer1_read (char *b) |
Sample layer1_read just calls read on stdin. More... | |
Layer 1 maintains byte ordering such that the receiver receives the first byte sent before receiving the second byte, etc.
Sample layer 1 implementation - this can be used to provide half-duplex communication by using the shell to create a pipe between a sender process and a receiver process.
Peer-to-peer and Interface Protocols Using C
Compile with: gcc -c layer1.c -o ../build/layer1.o
int layer1_read | ( | char * | b | ) |
Sample layer1_read just calls read on stdin.
[in] | b |
int layer1_write | ( | char | b | ) |
Sample layer1_write just calls write to stdout.
A chunk :: a sequence of bytes whose length is no greater than 16 bytes
[in] | b |