I am using a terminal as a host to input data (via copy/paste an arbitrary set of characters into the terminal). I want to capture this stream of data in my application.
I am using this code sample as a client to listen to the host. However, the output I receive is a small string, not equal to the size of the buffer. I anticipated the code to print out the string, equal to the size of the buffer.
> buffer size = 100;
> --
> sample input (copy/pasted into terminal): "here is a random string"
>
> current output: "h"
> expected output: "here is a random string"
How would I capture this "live" stream of data and have output consistent with the buffer, instead of a small string?