January 07, 2022

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

1 2 3 4
Next ›   Last »