A simple Internet Relay Chat (IRC) client implemented in C++98. The goal of this project is to provide a basic yet functional IRC client that allows users to connect to IRC servers, join channels, send and receive messages, and interact with other users in real-time.
Note
to test ft_irc run the tester:
# run the executable before running the tester
./ircserv <PORT> > <yourpassword>./irc_test.sh <PORT> > <yourpassword>- No crashes or unexpected quits.
- Must include a Makefile with rules:
$(NAME),all,clean,fclean,re. - Must compile with:
c++ -Wall -Wextra -Werror -std=c++98. - Use C++ equivalents of C functions where possible.
- No external libraries (including Boost).
- No forking. All I/O must be non-blocking.
- Must use exactly one
poll()(or equivalent) to handle all I/O. - Communication must happen over TCP/IP (IPv4 or IPv6).
-
Executable name:
ircserv -
Run as:
./ircserv <port> <password>
-
Acceptable source files:
.cpp,.h,.hpp,.tpp,.ipp, optional config file
You can use:
Everything in C++ 98.
socket, close, setsockopt, getaddrinfo, freeaddrinfo, bind, connect, listen, accept, htons, ntohs, send, recv, signal, fcntl, getsockname, getprotobyname, gethostbyname, htonl, ntohl, sigaction, lseek, fstat, poll (or equivalent).
Your server must:
-
Support multiple clients simultaneously.
-
Allow clients to:
- Authenticate (with password)
- Set nickname and username
- Join channels
- Send/receive private and channel messages
-
Forward all messages sent in a channel to all other participants.
-
Distinguish between operators and regular users.
- User commands:
NICK,USER,JOIN,PRIVMSG, etc.
- Channel operator commands:
KICK: Eject user from channelINVITE: Invite a user to a channelTOPIC: View or change channel topicMODE(with sub-modes):i: Invite-only channelt: Topic can only be changed by opsk: Channel key (password)o: Give/take operator statusl: User limit for the channel
- Handle partial reads/writes (e.g. messages arriving in segments).
- Parse and rebuild full commands before processing.
- The reference client should connect and work without errors, just like with a real IRC server.
Optional features:
- File transfers
- IRC bot
Using netcat:
nc -C 127.0.0.1 6667Type input like:
com
man
d
(using Ctrl+D to simulate broken-up message delivery).