SDL_net threadsafe? should I look into SDL_Net2?

After reading bob pendleton (bless his heart!)'s demonstrations on SDL_Net2,
I’m curious whether it’s even worth my while to be learning how to do
SDL_net, seeing as it’s apparently not thread-safe.

Does anybody else have recommendations for simple game/network programming
using using SDL, which you prefer? Even using directPlay in a windows
environment, I’d be open to alternatives.

I just don’t want to be programming halfway into my game and have to
re-engineer using a different library because of a structure deficiency in
the library.

Hi,

After reading bob pendleton (bless his heart!)'s demonstrations on SDL_Net2,
I’m curious whether it’s even worth my while to be learning how to do
SDL_net, seeing as it’s apparently not thread-safe.

Depends on what level of “thread safety” you need. If you put all
networking in a single thread, it doesn’t matter if the library is
thread-safe. SDL_Net2’s big advantage, as I understood it, is wrapping
the networking in the SDL event system.

Does anybody else have recommendations for simple game/network programming
using using SDL, which you prefer? Even using directPlay in a windows
environment, I’d be open to alternatives.

Well, I recently extended SDLnet to non-blocking TCP (Windows and *nix
only, so far), which makes networking in a single thread rather
painless. It’s not been thoroughly tested, but if you’re interested, I
could send you the code.

On the other hand, I recently discovered the OpenTNL networking system,
which seems very impressive. You may want to check it
(http://www.opentnl.org). It should be scalable to small applications,
and seems easy enough to work with, but the learning curve is terribly
steep.

I just don’t want to be programming halfway into my game and have to
re-engineer using a different library because of a structure deficiency in
the library.

Well, you could put a generic wrapper layer around networking, and
then you would only have to change the backend. Usually overkill, though :frowning:

Hope this helps,

Ben