Paul
Paul

Reputation: 167

How can I get started with cross platform network programming?

I'm thinking of purchasing this book to learn more on C/C++ networking programming:

I was just wondering is there/do I need a windows equivalent book (I do plan to code on both OS'). I'm not sure of the difference in the evolution regarding BSD sockets the windows.

I'm mainly buying this to eventually write code which will stream data between computers.

Upvotes: 3

Views: 2317

Answers (6)

Matt Ryan
Matt Ryan

Reputation: 261

Having done both, I'd definitely start out with the BSD version. Not only will you be learning something useful on both platforms (and others), but you'll have a better feel for what's really going on underneath.

I think the questions you need to ask yourself are:

  • How soon do you plan to add Windows to your network programming repertoire, AND
  • Do you want your code to be cross-platform

If you want your code to be cross-platform, I'd look at Boost or some other cross-platform network library to get you there quickly. If you are simply wanting to start out learning about network programming in general and then add Windows network programming specifically to your skillset, I'd start with the BSD API as you've planned and then get a resource for specifically doing this for Windows when you are ready. When I made the move from Linux to Windows I found it was worth the extra time to learn the Windows way of doing things.

Upvotes: 2

Josh
Josh

Reputation: 6473

Don't spend your money yet - I haven't personally found a better guide on networking than Beej's. http://beej.us/guide/bgnet/

Upvotes: 0

Jörgen Sigvardsson
Jörgen Sigvardsson

Reputation: 4887

For simple apps, BSD sockets will work just fine in Windows. But for the bells and whistles, I really recommend reading up on "native" winsock. Asynchronous sockets are really nice in GUI apps, and Overlapped I/O is just the bee's knees if you want high speed performance, without having to deal with threads (you can if you want to, but Windows will do it for you).

This is a good read.

Upvotes: 1

RocketR
RocketR

Reputation: 3766

There's Network Programming for MS Windows. I haven't read this yet, but will definitely do it as it looks very promising.

Upvotes: 0

Pablo Santa Cruz
Pablo Santa Cruz

Reputation: 181280

Even though you can use Windows API to do socket programming, I would recommend you learning BSD sockets API (or POSIX sockets API) and used it in BOTH: Windows and Linux.

Windows has great support for BSD sockets API.

And you will greatly benefit from a single code base instead of coding twice the same features. Besides, BSD/POSIX API is also available in many other UNIX flavors (MAC OS X, HP/UP, AI/X, BSD, you name it).

Upvotes: 1

Related Questions