Roger Oberholtzer wrote:
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.
fdopen() ? I'm pretty certain I have done that in the past, appropriately wrapped in select() or poll().
/Per Jessen, Zürich