1.7 KiB
1.7 KiB
Tasks for IRC
Useful info
You can try connect IRC server with
nc localhost <port>
User
Represents a connected IRC client.
| Attribute | Type | Description |
|---|---|---|
fd |
int |
TCP s-ocket file descriptor |
nick |
string |
IRC nickname |
username |
string |
Username |
realname |
string |
Real name |
buffer |
string |
Incoming data buffer, accumulates until \r\n |
authenticated |
bool |
true after correct PASS |
registered |
bool |
true after NICK + USER received |
Registration flow: PASS → authenticated → NICK + USER → registered → client ready
First stage
- [✓] Server starts
- [✓] It accepts two params, ./ircserv
- [✓] The server accepts one user, user can send messages and we can see from server
- [✓] Only 1 poll()
Second stage
- [✓] Server can handle multiple clients simultaneously
- [✓] Manage SO_REUSEADDR (restarting server fails to bind same port)
Third stage
- [✓] Dispatcher (select function for each command)
- Implement generic parser (extract command and pass args to command function)
- Client has nickname and username
- PASS command for authenticate
Fourth stage
- Client can create/connect to channels
- JOIN command (user can create channel)
- PRIVMSG command (send message to a channel)
It will continue...