SDL_Net API question

I’ve been looking a bit at SDL_Net and it looks pretty cool!

One question, though - I’ve noticed there are APIs to wait indefinitely
for packets to come in or APIs to return immediately if there are no
waiting packets. This seems to be the BSD sockets way of doing things.

What would be nice is an API that either does a wait until packet comes in
or time has expired, or the ability to provide a callback when a packet is
received. My game code has time dependent arrival time and I’d like it to
be as responsive as possible.

I guess the proper way to create a callback system is to create a network
worker thread that blocks waiting for packets to be received, and once
received, calls the callback procedure.

Any recommendations other than this or am I missing an API that does this
already? Thanks!

–>Neil-------------------------------------------------------------------------------
Neil Bradley "Your mistletoe is no match for my T.O.W. missile!"
Synthcom Systems, Inc. - Santabot - Futurama
ICQ #29402898

I’ve been looking a bit at SDL_Net and it looks pretty cool!

One question, though - I’ve noticed there are APIs to wait indefinitely
for packets to come in or APIs to return immediately if there are no
waiting packets. This seems to be the BSD sockets way of doing things.

What would be nice is an API that either does a wait until packet comes in
or time has expired, or the ability to provide a callback when a packet is
received. My game code has time dependent arrival time and I’d like it to
be as responsive as possible.

I guess the proper way to create a callback system is to create a network
worker thread that blocks waiting for packets to be received, and once
received, calls the callback procedure.

Any recommendations other than this or am I missing an API that does this
already? Thanks!

NET2 at http://gameprogrammer.com/game.html It uses a worker thread and
sends you events when input comes in.

	Bob PendletonOn Tue, 2004-04-13 at 12:47, Neil Bradley wrote:

–>Neil


Neil Bradley "Your mistletoe is no match for my T.O.W. missile!"
Synthcom Systems, Inc. - Santabot - Futurama
ICQ #29402898


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±--------------------------------------+