Quick 'n Dirty BSD Sockets
Introduction
Why write this? Mostly because I'd like to keep lots of code snippets here that I can later refer to in order to build software later. The idea is that by typing this stuff out, I'll achieve a number of personal benefits:
- I'm forced to think about it; this should help commit information to memory and help me trim those things which aren't "good"
- I'll be able to index and reference it
- I'll have a repository of boiler-plate code to reference
Additionally, YOU, the intertubes, get some benefit:
- You get to laugh at my terrible code
- You get to laugh even more
- You might find something useful
- Did I mention the laughing? It's good for your health
The goal is that by the end of this document, enough information will be available that anyone should be able to pick-up and write awesome network code.
Organization
One of the most important things about information is organization. To wit, this page will be organized as follows:
- Part 1 - Socket types, goals, options, and IO
- Part 2 - Programming from the client-side perspective (TCP/UDP)
- Part 3 - Programming from the server-side perspective (TCP/UDP)
- Part 4 - "Advanced" socket programming (security, scheduling, etc)
Scattered throughout this document will be code snippets, links to downloads, and references to 3rd party reading.
Outside Reading
- Beej's Guide to Network Programming is one of the best basic network programming primers available
- Alan Dix has a decent course synopsis site
If you have any other references, or resources, let me know (at my email).