[SDL] Problem in SDL_net docs + proposal for new functions

Gaëtan de Menten ged at bugfactory.org
Mon Jul 1 03:20:01 PDT 2002


> Gaëtan de Menten <ged at bugfactory.org> wrote:
>
> >  http://jcatki.no-ip.org/SDL_net/SDL_net_23.html
> > [...]

> int SDLNet_TCP_Recv(TCPsocket *sock, void *data, int maxlen)
>
> sock    This is a valid, connected, TCPsocket.
> data    This is a pointer to the buffer that receives the data from
>         sock.
> maxlen  This is the maximum length (in bytes) that will be read into
>         data.
>
> this is correct. the function will not return before maxlen bytes have
> been received, except the other side closes the socket.
This is correct indeed (I never said it wasn't), it's the two following
comments that are wrong...

> > 2) several small packets may arrive in a single "packet" (this caused
> > the problem I was talking about in my previous messages "Problem wh
> > SDLNet_TCP_Send (SDL_net)..." which is thus now resolved)
>
> it does not matter, if the ip-packets get fragmented or repackt. the
> kernel just waits for your buffer to fill and returns.
Is it just on windows or is it just my computer? But here, it doesn't wait
for the packet to be full to return, although I didn't specify anything
special.
It does wait for *some* data to be received. So I guess this is called
"blocking"...

-Gaëtan.





More information about the SDL mailing list