Difference between revisions of "SDL net"
(sdl_net seems unusable) |
Ghoulsblade (Talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
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.. | ||
+ | |||
+ | 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) | ||
+ | |||
+ | [[User:Ghoulsblade|Ghoulsblade]] 15:27, 18 March 2006 (CET) : ok, i see the problem, i didn't expect sdl-net to be so stupid. Well, i guess it's junk, so we'll write our own code =) |
Latest revision as of 14:27, 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)
Ghoulsblade 15:27, 18 March 2006 (CET) : ok, i see the problem, i didn't expect sdl-net to be so stupid. Well, i guess it's junk, so we'll write our own code =)