Skip to content

Commit

Permalink
README: typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Oct 31, 2023
1 parent 5a978ab commit 163b048
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ TLDR: This is just a programming example for a few friends of mine. I'll upload

And now, the full story:

Yesterday I was talking with a few friends of mine, front-end developers mostly, that are a bit far from system programming. We were remembering the old times of IRC. And inevitably I said: to write a very simple IRC server is an experience everybody should do (I showed them my implementation written in TCl; I was a quite shocked that I wrote it 18 years ago: time passes fast). There are very interesting parts in a program like that. A single process doing multiplexing, taking the client state and trying to access such state fast once a client has new data, and so forth.
Yesterday I was talking with a few friends of mine, front-end developers mostly, that are a bit far from system programming. We were remembering the old times of IRC. And inevitably I said: to write a very simple IRC server is an experience everybody should do (I showed them my implementation written in TCL; I was a quite shocked that I wrote it 18 years ago: time passes fast). There are very interesting parts in a program like that. A single process doing multiplexing, taking the client state and trying to access such state fast once a client has new data, and so forth.

But then the discussion evolved and I thought, I'll show you a very minimal example in C. But what is the smallest chat server you can write? For starters to be truly minimal we should not require any proper client. Even if not very well, it should work with `telnet` or `nc` (netcat). The server main operation is just to receive some chat line and send it to all the other clients, in what is sometimes called a fan-out operation. But yet, this would require a proper readline() function, then buffering, and so forth. We want it simpler: let's cheat using the kernel buffers, and pretending we every time receive a full-formed line from the client (an assumption that is in the practice often true, so things kinda work).
But then the discussion evolved and I thought, I'll show you a very minimal example in C. What is the smallest chat server you can write? For starters to be truly minimal we should not require any proper client. Even if not very well, it should work with `telnet` or `nc` (netcat). The server main operation is just to receive some chat line and send it to all the other clients, in what is sometimes called a fan-out operation. But yet, this would require a proper readline() function, then buffering, and so forth. We want it simpler: let's cheat using the kernel buffers, and pretending we every time receive a full-formed line from the client (an assumption that is in the practice often true, so things kinda work).

Well, with this tricks we can implement a chat that even has the ability to
let the user set their nick in just 200 lines of code (removing spaces
Expand Down

0 comments on commit 163b048

Please sign in to comment.