I simulate packets from a source that creates packets with a given packet / second interval. I want to create a stream class that works as an object ostream, allowing operator<<it to be used to output data through it, but with the caveat that each inserted value must be freed from the buffer in the file descriptor, so that, at a certain interval.
So, for example, I can have a socket with a file descriptor sockfdand say:
MyBuffer buffer(sockfd, 1000);
buffer << 1 << 2 << 3;
and the output will be synchronized so that it outputs
1
<1 second gap>
2
<1 second gap>
3
. Boost.Iostreams , ? - , Google, , ?
.