Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packets, contiguous memory, and buffer chains #62

Open
guruofquality opened this issue Feb 27, 2016 · 0 comments
Open

packets, contiguous memory, and buffer chains #62

guruofquality opened this issue Feb 27, 2016 · 0 comments

Comments

@guruofquality
Copy link
Contributor

From @guruofquality on January 29, 2015 4:57

There are a few cases that come up where we end up copying buffers to form a contiguous buffer for a packet message:

  • Consider the label deframer which might concatenate several buffers to form a complete packet.
  • Consider a protocol framer which appends a protocol header with a payload buffer.

It might be desirable to have a chain of buffers constitute a packet and to pass this chain around instead. This would allow the consumer to decide that it must copy them into contiguous memory to perform useful work. In some cases, the buffers can just be forwarded, truncated, and sliced up as-is and we want to enable this possibility.

This basic concept already applies to the stream domain, it would be nice to bring it over to the packet domain and allow for the two to interchange fairly easily. We might create a BufferChain object which is basically a vector/list/queue of BufferChunks with some convenience routines for removal, pushing to a stream, overall length, appending...

Copied from original issue: pothosware/pothos-library#94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant