[ prog / sol / mona ]

prog


Network Programming

1 2018-11-23 20:02

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?

2 2018-11-24 05:02

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.

3 2018-11-27 20:17

Ryc

4 2018-11-27 20:18

Fff

5 2018-11-30 07:04

guile has some good shit

6 2018-12-02 15:05

guile has some good shit +1

7 2018-12-02 16:50

You should try guile indeed

8 2018-12-04 12:55

TCP/IP Sockets in C: Practical Guide for Programmers

Also erlang.

9 2018-12-06 02:36

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.

10 2018-12-06 18:59

>>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.

11 2018-12-25 15:00 *

dubs

12


VIP:

do not edit these