summaryrefslogtreecommitdiff
path: root/doc/technical/fd-management.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/technical/fd-management.txt')
-rw-r--r--doc/technical/fd-management.txt47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/technical/fd-management.txt b/doc/technical/fd-management.txt
new file mode 100644
index 0000000..cb98e3f
--- /dev/null
+++ b/doc/technical/fd-management.txt
@@ -0,0 +1,47 @@
+Overview of the filedescriptor subsystem
+Adrian Chadd <adrian@creative.net.au>
+
+$Id$
+
+
+Filedescriptor lists
+--------------------
+
+The filedescriptor list is managed through the routines in fdlist.c .
+These include:
+
+fd_open() - tag an FD as "open" and active
+fd_close() - tag an FD as "closed" and close() the filedescriptor
+fd_note() - update the filedescriptor tag
+
+You can get the current list of open filedescriptors through /stats F as
+an oper.
+
+
+
+FD lists
+--------
+
+The FD list support is very alpha. There are a few lists defined:
+
+typedef enum fdlist_t {
+ FDLIST_NONE,
+ FDLIST_SERVICE,
+ FDLIST_SERVER,
+ FDLIST_IDLECLIENT,
+ FDLIST_BUSYCLIENT,
+ FDLIST_MAX
+} fdlist_t;
+
+FDLIST_NONE Not on any list (ie close()d)
+FDLIST_SERVICE A service - listen() sockets, resolver, etc
+FDLIST_SERVER Server connections
+FDLIST_IDLECLIENT An idle client
+FDLIST_BUSYCLIENT A busy client
+FDLIST_MAX Used for bounds checking
+
+The idea is that the SERVICE sockets need polling frequently, the SERVER
+sockets also need polling frequently, BUSYCLIENT is for busy clients
+which need frequent polling (eg we're trying to write to them), and
+IDLECLIENT is for clients which we don't need to poll frequently.
+THIS hasn't been decided upon yet.