SDL_net -- receiving exactly n bytes?

Using the SDL_net library, is there a good way to make the call to
SDLNet_TCP_Recv(sock, *data, length) not return until exactly length bytes
have been received? At least on Win32 (I know not how it works on other
platforms), it does not seem to want to return anything greater than 1 byte
at a time, meaning I’ll have to reconstruct the packet at the receiving end.

At 09:40 PM 8/3/02 -0400, you wrote:

Using the SDL_net library, is there a good way to make the call to
SDLNet_TCP_Recv(sock, *data, length) not return until exactly length bytes
have been received? At least on Win32 (I know not how it works on other
platforms), it does not seem to want to return anything greater than 1
byte at a time, meaning I’ll have to reconstruct the packet at the
receiving end.

Curiouser and curiouser… the client program apparantly is reading in the
entire packet (of size 14 bytes), but TCP_Recv only return 1. On the other
hand, the server program’s only getting one byte at a time for the reply
packets, and TCP_Recv properly returns 1. Is it supposed to matter whether
the socket is in a socketset or not?

At 10:01 PM 8/3/02 -0400, I wrote:

Curiouser and curiouser… the client program apparantly is reading in the
entire packet (of size 14 bytes), but

Ahah – As usual with these kinds of problems, I found the error in my code
and fixed it. :slight_smile: