# SDL network everywhere.. is it allowed?

## Recommended Posts

valla2    100
Now i am learning how to use SDL_net for my games. Would it be good to use it everywhere, even in the cases that i don't write games? Because i don't know how to use the win32 sockets.h, is it good to use SDL_net for a program that has nothing to do with graphics and games? like...
#inlude <iostream>    // input - output
#inlcude <vector>
#inlcude <windows.h>  // some windows functions
#include <SDL_net.h>  // for network

or is it missleading or something? oh and btw can a program written with win32 API be used in Longhorn? thx in advance

##### Share on other sites
Monder    993
Well you can use SDL_net wherever you want just be aware of what dependancies it has (I'm not sure but you may be able to use it without having to use the base SDL library).

Unmanaged applications (such as ones using the Win32 API) will run just fine in Longhorn.

##### Share on other sites
valla2    100
thank you Monder :)

i know i can do it, i am asking if it would be a good idea? Or should i learn other windows specific APIs to do my networking programming in my utility programs, and just use SDL_net in my gmaes(probalby because its cross-platfom)?
So.. if SDL_net is good and cross platform, why not use it everywhere?

thanks :)

##### Share on other sites
Kylotan    9873
To be honest, networking with normal Berkeley sockets/Winsock is not all that hard, and not much easier than SDL_Net really. And the benefit of learning the general way is that you're not dependent on SDL, which will be a good thing if you're writing business software or whatever.

##### Share on other sites
CodeMunkie    805
Wait, you can't use SDL in buisness software? I thought it was LGPL, meaning it was kosher in commercial apps as long as you dynamically link. Is that not right?

##### Share on other sites
Kylotan    9873
I wasn't referring to the license, more the practicality. Generally you won't want to bundle in the SDL baggage when you're just writing a simple business app.

##### Share on other sites
Monder    993
If you dynamically link to it you can use it in whatever you want.

What I think Kylotan meant was in something such as business software (where you will be likely to be working in a team) you'll want to use winsock for network stuff (if you need low-level networking anyway) as SDL_Net isn't exactly a widely known and used library in business applications. If you understand SDL_Net you should be able to pick up winsock without many problems anyway.

Beaten to it[/edit]

##### Share on other sites
CodeMunkie    805
Ok, good points!

##### Share on other sites
valla2    100
ok thanks :) Are there any other cross platform alternatives to it?

##### Share on other sites
Squirm    481
Heaps. Have a look in the multiplayer and network programming FAQ here on gamedev.

##### Share on other sites
Rebooted    612
Berkley sockets on Unix is very similar to winsock on Windows.

##### Share on other sites
valla2    100
thx but the faq doesn't say if there are any good cross-platform libraries for networking

??

##### Share on other sites
Squirm    481
Quote:
 Q8) What are some other networking libraries that often get mentioned in the forum?A8) Low-level "sockets portability" libraries include: Enet, HawkNL, PLib/Medusa and SDL_net.High-level "we give you structure" libraries include: ClanLib, Net-Z/Eterna, Nevrax/NEL, OpenSkies, OpenTNL, RakNet and ReplicaNet.Mention (or the absense of mention) of a specific library does not mean gamedev.net or the moderator endorses (or counter-endorses) that library.

I use raknet under linux, and I rather like it.