On 1/7/22 5:04 PM, eugene wrote:
On Friday, 7 January 2022 at 21:17:33 UTC, Steven Schveighoffer wrote:
In C you have one choice (printf), but that choice may not fit your needs.

There are 2 buffers (RX one and TX one, both of 'reasonable' size)
(it's the effing echo-server, nothing more)

Irrelevant to how you log the data.

* print content of RX-buffer, ommiting terminating '\n' ('\n' is the 'end of request') to (log/journal file)/stdout/

* ouptut received 'message' back to client, _with_ terminating '\n'

Since the data is unmodified, then you can do this too after logging it without the `\n`. Two separate needs, both well handled by using ranges and algorithms.

Or if they don't suit you well enough, just write your own. Writing a wrapping range isn't hard.

-Steve

Reply via email to