-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubject_en.txt
More file actions
86 lines (79 loc) · 4.25 KB
/
subject_en.txt
File metadata and controls
86 lines (79 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
You have to develop an IRC server in C++ 98.
You mustn’t develop a client.
You mustn’t handle server-to-server communication.
Your executable will be run as follows:
./ircserv <port> <password>
• port: The port number on which your IRC server will be listening to for incoming
IRC connections.
• password: The connection password. It will be needed by any IRC client that tries
to connect to your server.
(i)
Even if poll() is mentionned in the subject and the evaluation scale,
you can use any equivalent such as select(), kqueue(), or epoll().
Requirements
• The server must be capable of handling multiple clients at the same time and never
hang.
• Forking is not allowed. All I/O operations must be non-blocking.
• Only 1 poll() (or equivalent) can be used for handling all these operations (read,
write, but also listen, and so forth).
Because you have to use non-blocking file descriptors, it is
possible to use read/recv or write/send functions with no poll()
(or equivalent), and your server wouldn’t be blocking.
But it would consume more system resources.
Thus, if you try to read/recv or write/send in any file descriptor
without using poll() (or equivalent), your grade will be 0.
• Several IRC clients exist. You have to choose one of them as a reference. Your
reference client will be used during the evaluation process.
• Your reference client must be able to connect to your server without encountering
any error.
• Communication between client and server has to be done via TCP/IP (v4 or v6).
• Using your reference client with your server must be similar to using it with any
official IRC server. However, you only have to implement the following features:
◦ You must be able to authenticate, set a nickname, a username, join a channel,
send and receive private messages using your reference client.
◦ All the messages sent from one client to a channel have to be forwarded to
every other client that joined the channel.
◦ You must have operators and regular users.
◦ Then, you have to implement the commands that are specific to operators.
• Of course, you are expected to write a clean code.
(!)
• Several IRC clients exist. You have to choose one of them as a reference. Your
reference client will be used during the evaluation process.
• Your reference client must be able to connect to your server without encountering
any error.
• Communication between client and server has to be done via TCP/IP (v4 or v6).
• Using your reference client with your server must be similar to using it with any
official IRC server. However, you only have to implement the following features:
◦ You must be able to authenticate, set a nickname, a username, join a channel,
send and receive private messages using your reference client.
◦ All the messages sent from one client to a channel have to be forwarded to
every other client that joined the channel.
◦ You must have operators and regular users.
◦ Then, you have to implement the commands that are specific to operators.
• Of course, you are expected to write a clean code.
For MacOS only
Since MacOS doesn’t implement write() the same way as other Unix
OSes, you are allowed to use fcntl().
You must use file descriptors in non-blocking mode in order to get a
behavior similar to the one of other Unix OSes.
(!)
However, you are allowed to use fcntl() only as follows:
fcntl(fd, F_SETFL, O_NONBLOCK);
Any other flag is forbidden.
Test example
Verify absolutely every possible error and issue (receiving partial data, low bandwidth,
and so forth).
To ensure that your server correctly processes everything that you send to it, the
following simple test using nc can be done:
\$> nc 127.0.0.1 6667
com^Dman^Dd
\$>
Use ctrl+D to send the command in several parts: ’com’, then ’man’, then ’d\n’.
In order to process a command, you have to first aggregate the received packets in order to rebuild it.
Bonus part
Here are the extra features you can add to your IRC server so it looks even more like and actual IRC server:
• Handle file transfer.
• A bot.
The bonus part will only be assessed if the mandatory part is PERFECT.
Perfect means the mandatory part has been integrally done and works without malfunctioning.
If you have not passed ALL the mandatory requirements, your bonus part will not be evaluated at all.