Re: FILE* behaviour over BSD sockets - how?

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


Date: Thu, 13 May 2004 14:37:21 GMT

S?ren Hansen <sh@warma.dk> wrote:
> On Wed, 12 May 2004 18:21:19 +0000, Aurelian Melinte wrote:
>
>> 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.
>
> I've never tried using it on sockets, but perhaps fdopen() will do the
> trick?
>

Yes, fdopen succeeds on sockets



Relevant Pages

  • Re: FILE* behaviour over BSD sockets - how?
    ... Rich Teer writes: ... The socket has been set to blocking and I ... the API reads once in a while ...
    (comp.unix.programmer)
  • Re: FILE* behaviour over BSD sockets - how?
    ... The socket has been set to blocking and I ... the API reads once in a while ... >> incomplete records because the underlying socket calls seem to return ...
    (comp.unix.programmer)
  • Re: FILE* behaviour over BSD sockets - how?
    ... The socket has been set to blocking and I successfully ... the API reads once in a while incomplete records ...
    (comp.unix.programmer)
  • Re: FILE* behaviour over BSD sockets - how?
    ... The socket has been set to blocking and I successfully ... the API reads once in a while incomplete records ...
    (comp.unix.programmer)
  • Re: recv blocks although socket is ready
    ... of the members of the interface in my network layer have blocking ... Only one has non-blocking semantics. ... call any socket operation and rely on the socket to block. ... Now I have to implement blocking myself in all other ...
    (microsoft.public.win32.programmer.networks)