Difference between revisions of "SDL net"

From SfzWiki
Jump to: navigation, search
(sdl_net seems unusable)
 
Line 1: Line 1:
 
[http://jcatki.no-ip.org/SDL_net/SDL_net.html#SEC23] 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.
 
[http://jcatki.no-ip.org/SDL_net/SDL_net.html#SEC23] 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.
 +
 +
[[User:Ghoulsblade|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..

Revision as of 17:15, 16 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..