Startup & registration
The first things a client meets.
- Checks ./ircserv <port> <password>: the port must be numeric, and reserved ports 0 to 1023 are refused
- PASS and USER registration, with error 464 when the password is wrong
42 Project brief
An IRC server in C++98 that real IRC clients can connect to, built in a team of three. I wrote the command layer: parsing, the channel and message commands, error replies and the bonus bot.
ft_irc is the 42 networking project: write an IRC server in C++98, with no external libraries, that a real IRC client can use. One process serves every connection with non-blocking sockets and a single poll() loop.
Users register with the server password, pick a nickname, join channels, talk in channels or in private, and channel operators can set the topic, change modes and kick people.
The team’s stack
I made about 110 of the 232 commits, the most on the team. My two teammates built the socket and poll() core and the code that receives data.
The first things a client meets.
Turning raw lines from the socket into commands.
The commands people use all the time.
Moderation, and a small bot built into the server.
The poll() loop hands the parser a line such as JOIN #a,#b key1,key2.
The channel list and the key list are split on commas and paired up.
Every name must start with #, otherwise the client gets error 476, bad channel mask.
An existing channel checks its password before adding the user; a new one is created with that key.
The user gets the join confirmation and the list of members.