Roger Oberholtzer wrote:
On Thu, 2010-09-30 at 20:49 +0200, Per Jessen wrote:
fdopen() ? I'm pretty certain I have done that in the past, appropriately wrapped in select() or poll().
Too obious:) As in, why didn't I think of that...
I wonder if it does a read of one character at a time (lots of system calls!) or if it reads blocks and fiddles with buffers. I guess I will try and see what strace tells me.
I've checked some of my code, and I've used fdopen() for things like line-based protocols (SMTP). AFAICT, there is not much difference between buffered reads on a file and a socket. The one thing is that the socket can get disconnected, but that should get represented appropriately. /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org