FILE* behaviour over BSD sockets - how?

From: Aurelian Melinte (amelinte_at_b504-12.info.polymtl.ca)
Date: 05/12/04


Date: Wed, 12 May 2004 18:21:19 GMT


Hello,

I am looking to make a socket behave like a FILE*.

The problem: I have to use a library (which I cannot modify) with an API reading/writing records to FILE*. The data I have to read comes through a socket. The socket has been set to blocking and I successfully fdopen(socket). However, the API reads once in a while incomplete records because the underlying socket calls seem to return as soon as there is a packet to read but not when the whole requested number of bytes has been read.

Do not see any solution...

Regards,
a.