TCP is of course stream oriented. It does not have a concept of lines. Serial ports, of course, can be configured as stream, line, character, whatever.
I have a function that I want to make work on either a serial or a TCP port. I want this to be line oriented. Of course, I know how to do this reading a character at a time and taking appropriate action.
On the other hand:
On the serial port I can arrange it so reads are satisfied when there is a whole line. That is, each read returns only when a whole line is available.
My question: Is there some obscure TCP ioctl() that would let me get the same for TCP streams? I have looked, and I do not see anything in the standard Linux networking docs. I don't really expect that there is such a mode, but I thought I would ask around a bit before doing the character-at-a-time thing.
TIA for any pointers.