Has anyone here done any serious network programming? There are a few programs I'd like to write, but they all deal with networking and I've never written a non-trivial networked program.
What are your favourite resources? Any advice?
It depends what level you're working on. Writing a simple HTTP API is easy. With most micro-frameworks, you just write callbacks for each URL suffix and HTTP method pairs you support. With others, you just write a callback for when somebody sends a HTTP request. The callback returns the HTTP response you send back.
If you're doing stuff at the socket level, you're going to have to write a parser, and that's a huge pain to do correctly with all but the simplest formats, since end of message doesn't necessarily mean end of packet and you could get a disconnect before the full message is sent. You can always cop out and assume every packet will contain a full message, load the contents into a buffer, and attempt to parse it. That'll mostly work as long as the messages are short. Anything less than a kilobyte at a time should be fine most of the time.
Ryc
Fff
guile has some good shit
guile has some good shit +1
You should try guile indeed
TCP/IP Sockets in C: Practical Guide for Programmers
Also erlang.
Just to add a bit of diversity, Foment, Gauche, & Sagittarius distribute SRFI-106 if you're interested in a portable solution. (or perhaps rather a solution which may become portable) For the sake of future portability you lose HTTP & URI parsers aswell as a number of convience functions in the web-client & web-server libraries you have in guile which are very very nice.
>>9
At this point it's seems reasonable to make solid cross implementation libraries building off only R7RS and SRFI's. It's just a matter of these standards being supported.
dubs