Portable network

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This is not really a question concerning SDL, but I think many SDL
developers have experience in this because SDL is concerned to be
portable and many games are designed to be played over network.
Does anyone know some portable (especially running on Windows and Linux)
libraries that offer an interface to deal a network? Something that
would run under Mingw-make and under Gnu/Make(Linux) without rewriting
the whole code? Does anyone have a link to a turorial or at least a
reference?
Thanks in advance
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFm99UU1HHlyWJMowRAnU3AJ0YFtCkzooBvIZNQbNWhItrYfX4YgCeIni4
7hoZO2w92IrMvYU/KTTP8Xk=
=p8I2
-----END PGP SIGNATURE-----

I find SDL_net really good. It provides a good interface for UDP and TCP
sockets. I’ve recently started to use the SocketSets routines (part of
SDL_net) and find that it works really well.

Also, SDL_net integrates or is integrated (?) into SDL and are available via
libsdl.org.

I mainly program for Linux (openSUSE) and find that the RPMs supplied by
openSUSE to work great.

Here are some links:

SDL_net Homepage: http://www.libsdl.org/projects/SDL_net/
SDL_net API Doc: http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fnet

AlvinOn Wednesday 03 January 2007 12:52, Viktor Dick wrote:

This is not really a question concerning SDL, but I think many SDL
developers have experience in this because SDL is concerned to be
portable and many games are designed to be played over network.
Does anyone know some portable (especially running on Windows and Linux)
libraries that offer an interface to deal a network? Something that
would run under Mingw-make and under Gnu/Make(Linux) without rewriting
the whole code? Does anyone have a link to a turorial or at least a
reference?
Thanks in advance

Well, there is SDL_net, for the basic TCP and UDP stuff.
http://www.libsdl.org/projects/SDL_net/

For a nice and clean event driven layer over SDL_net, try NET2:
http://gameprogrammer.com/net2/net2-0.html

Of course, you still need to implement your protocol, as both of the
above deal with “raw” TCP and UDP. Most importantly (for
portability), if you want to communicate anything other than strings
of 8 bit characters, you’ll need to make sure the protocol
implementation deals with endianness. (Or PPC Macs won’t be able to
talk to Intel Macs or other x86 machines, for example.)

There are various higher level, more domain specific solutions as
well, but I haven’t used any of them. If all you need is non real
time TCP, it’s pretty trivial to roll your own, but making proper use
of UDP can be a bit trickier. You’ll need to deal with packets
arriving out of order och being dropped, and for a real time game,
you’ll probably need to implement interpolation and prediction to
deal with “high ping” and dodgy connections.

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Wednesday 03 January 2007 17:52, Viktor Dick wrote:

This is not really a question concerning SDL, but I think many SDL
developers have experience in this because SDL is concerned to be
portable and many games are designed to be played over network.
Does anyone know some portable (especially running on Windows and
Linux) libraries that offer an interface to deal a network?
Something that would run under Mingw-make and under Gnu/Make(Linux)
without rewriting the whole code? Does anyone have a link to a
turorial or at least a reference?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks! I had forgotten that SDL has also this extension. That was the
answer I needed. Now I can base my whole project on SDL.

David Olofson schrieb:> On Wednesday 03 January 2007 17:52, Viktor Dick wrote:

This is not really a question concerning SDL, but I think many SDL
developers have experience in this because SDL is concerned to be
portable and many games are designed to be played over network.
Does anyone know some portable (especially running on Windows and
Linux) libraries that offer an interface to deal a network?
Something that would run under Mingw-make and under Gnu/Make(Linux)
without rewriting the whole code? Does anyone have a link to a
turorial or at least a reference?

Well, there is SDL_net, for the basic TCP and UDP stuff.
http://www.libsdl.org/projects/SDL_net/

For a nice and clean event driven layer over SDL_net, try NET2:
http://gameprogrammer.com/net2/net2-0.html

Of course, you still need to implement your protocol, as both of the
above deal with “raw” TCP and UDP. Most importantly (for
portability), if you want to communicate anything other than strings
of 8 bit characters, you’ll need to make sure the protocol
implementation deals with endianness. (Or PPC Macs won’t be able to
talk to Intel Macs or other x86 machines, for example.)

There are various higher level, more domain specific solutions as
well, but I haven’t used any of them. If all you need is non real
time TCP, it’s pretty trivial to roll your own, but making proper use
of UDP can be a bit trickier. You’ll need to deal with packets
arriving out of order och being dropped, and for a real time game,
you’ll probably need to implement interpolation and prediction to
deal with “high ping” and dodgy connections.

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --’
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFnARnU1HHlyWJMowRAjZoAKDIcMHwfT+ky2i0wESUjU8mMChDOACcDV9x
1+sbTjlGp/1izKFmYB5eodk=
=sxgo
-----END PGP SIGNATURE-----