About · Usage · Features · What I Learned
ft_irc is a small, student-implemented IRC server that reproduces the core behavior of the Internet Relay Chat protocol (RFC 1459 and common extensions) for learning purposes. The project focuses on:
- low-level network programming with sockets,
- concurrent client handling with non-blocking I/O (poll/select),
- parsing and executing IRC commands,
- implementing channel and user state management,
- robust error handling and graceful disconnects.
See the project subject in the repository for the full specification and mandatory behaviour.
- A POSIX-compatible system (Linux, macOS)
- C compiler (gcc / clang)
- Make (Makefile provided)
- No external libraries required (uses standard libc and POSIX APIs)
From the project root:
$ makeThis will produce the server binary (e.g. ircserv). Standard Make targets are available:
make— buildmake clean— remove object filesmake fclean— remove objects and binariesmake re— fclean + make
Start the server:
$ ./ircserv <port> <password>Example:
$ ./ircserv 6667 secretpassConnecting with an IRC client:
-
Using hexchat / irssi:
/connect -password secretpass 127.0.0.1 6667
-
Using netcat / telnet for manual tests (raw protocol):
$ nc -C 127.0.0.1 6667
NICK mynick
USER mynick 0 * :Real NameAfter registering (NICK + USER), you can JOIN channels and send messages:
JOIN #channel
PRIVMSG #channel :Hello, world!
PART #channel
The server expects commands terminated by CRLF (\r\n) and follows common IRC reply conventions where applicable.
Implemented behavior typically includes:
- Accepting multiple simultaneous client connections
- Non-blocking I/O and efficient polling loop (select/poll)
- Parsing and handling of core IRC commands:
- NICK, USER, JOIN, PART, PRIVMSG, NOTICE, PING/PONG, QUIT
- Channel creation and membership management
- Basic message routing between users and channels
- Graceful client disconnect and resource cleanup
- Simple validation and error replies to malformed commands
Behaviors implemented:
- MODE (channel and user modes)
- TOPIC
- KICK
- INVITE
- TOPIC, CHANLIMITS and channel creation rules
- Registration timeout
- Manual tests with netcat / telnet as above
- Connect multiple clients and verify message routing and channel state
- Verify server handles abrupt client disconnects and malformed input
- Optionally use an IRC client (irssi/weechat) for interactive testing
- First time used Test Driven Development and I saw how it can help me focus my thought and build robust programs
- Low-level network programming with sockets (bind, listen, accept)
- Non-blocking I/O and multiplexing with poll/select
- Protocol design and robust parsing of line-based protocols
- Managing shared server state (users, channels) safely in an event loop
- Debugging networking issues (partial reads/writes, disconnected peers)
- Designing simple but resilient command handling and error reporting