LifebloodNetworks.com Projects
network_buffer
network_buffer is a C++ solution to a "problem" TCP presents. When trying to send data over TCP some of it (or all of it) may not send. One then needs to detect which data sent and only attempt to re-send the data which did not send. This process may have to be repeated over and over again until all data is sent. This can lead to a lot of redundant and messy code.
network_buffer provides a buffer that will automatically do this work for you. network_buffer provides functions to read, write and byte-swap:
- Bytes
- Unsigned Bytes
- Signed Short Integers
- Unsigned Short Integers
- Signed Long Integers
- Unsigned Long Integers
- Floats
- Doubles
- C-Style Strings
- Arbitrary Blocks of Data
Current Limitations
- Strings and blocks can only be up to 256 bytes long (including the null termination character for strings).
- All data is stored in its own buffer before being sent only one buffer at a time. This can lead to a very, very inefficent situation if Nagle's algorithm is disabled-- the current version of HawkNL (v1.70b1) has this enabled by default-- or if the program sends data too slowly.
Possible to-do's for Future Versions
- Support for std::string
- Support larger sized strings and blocks
- Re-write send functionality so more than one buffer is written at a time
- Example of proper usage
Download
- network_buffer v.9 [7-Zip | Zip] (Untested with anything other than TCP)
HawkNL required. Tested with v1.70b1.
I recommend 7-Zip.
Projects Using network_buffer