CORDIAL MINUET ENSEMBLE

??????

You are not logged in.

#1 2015-03-26 17:07:55

computermouth
Member
Registered: 2014-12-27
Posts: 134

OffTopic: C/C++ Networking

I know we've got some programmers in here. Could anyone recommend a C/C++ Networking library or tutorials? I'm having a bit of a hard time absorbing sockets, streams, and datagrams. Any suggestions for anything a little more abstracted?


Try Linux, get free. #!++ (CrunchbangPlusPlus) is a stable distribution based on Debian 8. Keep it fast, keep it pretty.

Offline

#2 2015-03-26 17:40:09

jasonrohrer
Administrator
Registered: 2014-11-20
Posts: 802

Re: OffTopic: C/C++ Networking

Socket programming is pretty arcane.  There are so many settings and such.

I always just copied example code (oh... THOSE are the settings you need...) and wrote a wrapper around it to simplify things.  I recall this ancient "Unix Socket FAQ" being really helpful:

http://www.faqs.org/faqs/unix-faq/socket/


I think SDL has a wrapper for platform-independent sockets.  SDL is also useful for other stuff (keyboard, mouse, sound).

Offline

#3 2015-03-26 17:59:22

computermouth
Member
Registered: 2014-12-27
Posts: 134

Re: OffTopic: C/C++ Networking

I've been using SDL2 a lot and I love it, but SDL_net gets a little hairy. That link looks like it's got some good information though. Thanks Jason!


Try Linux, get free. #!++ (CrunchbangPlusPlus) is a stable distribution based on Debian 8. Keep it fast, keep it pretty.

Offline

#4 2015-03-26 20:24:31

jasonrohrer
Administrator
Registered: 2014-11-20
Posts: 802

Re: OffTopic: C/C++ Networking

Well... I don't know that there's a way to code networking that doesn't get a little hairy...

It's called a Unix beard for a reason...

Offline

#5 2015-03-28 02:58:02

..
Member
Registered: 2014-11-21
Posts: 259

Re: OffTopic: C/C++ Networking

I've done very little network programming, but by coincidence I was looking for networking libraries yesterday.

Yes, SDL_net provides a low level interface, but I still think it's a pretty good interface. You might think that it's providing you with little (it's only 1500 LOC), or that it's hairy, but I had a look at its source, and it's sure shielding you from a lot of nasty gunk stuck in the drain pipes. Also, it seems that SDL_net can be compiled without a dependency on SDL.

I personally also wanted some library that provides more in the way of abstractions, and didn't come to any conclusion, except that if you ever want to do raw UDP networking, don't, use ENet instead (there are other libraries for reliable UDP, but ENet seems to be very popular). ENet doesn't do TCP, and while it reimplements most of TCP, if I want guarantees then I'd rather have all of TCP.

Last edited by .. (2015-03-28 03:06:28)

Offline

#6 2015-03-28 14:51:25

computermouth
Member
Registered: 2014-12-27
Posts: 134

Re: OffTopic: C/C++ Networking

jasonrohrer wrote:

It's called a Unix beard for a reason...

Get my Dennis Ritchie on!
1997_dennis_ritchie.jpg

Oh ENet! I looked into that quite some time ago, it _does_ look a lot more naturally readable.

I've gotten a basic pinging UDP server/client up in SDL_net, but I might have to check out ENet again too. I'd rather keep it all down to SDL but ENet's documentation says it already includes ordering and verification, which would be nice to not have to program myself.


Try Linux, get free. #!++ (CrunchbangPlusPlus) is a stable distribution based on Debian 8. Keep it fast, keep it pretty.

Offline

Board footer

Powered by FluxBB