]> jfr.im git - irc/rqf/shadowircd.git/blob - doc/technical/fd-management.txt
Branch Merge
[irc/rqf/shadowircd.git] / doc / technical / fd-management.txt
1 Overview of the filedescriptor subsystem
2 Adrian Chadd <adrian@creative.net.au>
3
4
5
6 Filedescriptor lists
7 --------------------
8
9 The filedescriptor list is managed through the routines in fdlist.c .
10 These include:
11
12 fd_open() - tag an FD as "open" and active
13 fd_close() - tag an FD as "closed" and close() the filedescriptor
14 fd_note() - update the filedescriptor tag
15
16 You can get the current list of open filedescriptors through /stats F as
17 an oper.
18
19
20
21 FD lists
22 --------
23
24 The FD list support is very alpha. There are a few lists defined:
25
26 typedef enum fdlist_t {
27 FDLIST_NONE,
28 FDLIST_SERVICE,
29 FDLIST_SERVER,
30 FDLIST_IDLECLIENT,
31 FDLIST_BUSYCLIENT,
32 FDLIST_MAX
33 } fdlist_t;
34
35 FDLIST_NONE Not on any list (ie close()d)
36 FDLIST_SERVICE A service - listen() sockets, resolver, etc
37 FDLIST_SERVER Server connections
38 FDLIST_IDLECLIENT An idle client
39 FDLIST_BUSYCLIENT A busy client
40 FDLIST_MAX Used for bounds checking
41
42 The idea is that the SERVICE sockets need polling frequently, the SERVER
43 sockets also need polling frequently, BUSYCLIENT is for busy clients
44 which need frequent polling (eg we're trying to write to them), and
45 IDLECLIENT is for clients which we don't need to poll frequently.
46 THIS hasn't been decided upon yet.