Difference between revisions of "SDL net"

From SfzWiki
Jump to: navigation, search
Line 5: Line 5:
 
why would you want to retrieve only part of the buffer ?
 
why would you want to retrieve only part of the buffer ?
 
it must be copyed to a local fifo anyhow, as messages don't have a fixed size, and you cannot determine if a message is complete until you look at the first bytes..
 
it must be copyed to a local fifo anyhow, as messages don't have a fixed size, and you cannot determine if a message is complete until you look at the first bytes..
 +
 +
if the network recieved 32 bytes and i called a recv with a 64 buffer the function will block until another 32 bytes arive. - [[User:Hagish|hagish]] 10:21, 18 March 2006 (CET)

Revision as of 09:21, 18 March 2006

[1] recv() is a blocking function. blocks until the complete buffer is read. i don't find a function to get the number of readable bytes, so SDL_net seems to be useless or only usefull with workarounds. due to the need for speed in the net code i canceld the rewrite to sdl_net.

Ghoulsblade 18:15, 16 March 2006 (CET):you can check, if there is anything to be read with socket-sets : http://jcatki.no-ip.org/SDL_net/SDL_net.html#SEC40

why would you want to retrieve only part of the buffer ? it must be copyed to a local fifo anyhow, as messages don't have a fixed size, and you cannot determine if a message is complete until you look at the first bytes..

if the network recieved 32 bytes and i called a recv with a 64 buffer the function will block until another 32 bytes arive. - hagish 10:21, 18 March 2006 (CET)