ft_irc: Building an IRC Server in C++98
January 10, 2023
École 42
Related Posts
Hi! ft_irc asks for a real IRC server in C++98 — one that genuine IRC clients can connect to. Another team project with cryonayes, and the first time my code spoke a real, standardized network protocol.
PASS, NICK, USER),PRIVMSG/NOTICE,KICK, INVITE, TOPIC, MODE (i/t/k/o/l),The hardest part is not any single command — it is the stream nature of TCP. Commands arrive split across packets or glued together, so you need buffering per client and a parser that only acts on complete messages. Add partial sends, disconnects at the worst possible moment, and numeric replies that must match the RFC closely enough for real clients (we tested with irssi) to behave. NetPractice taught me how packets find a host; ft_irc taught me what happens after they arrive.
Source code: github.com/cryonayes/ft_irc
