summaryrefslogtreecommitdiff
path: root/docs/api-docs/common/lib_common/WaitForEvent.txt
diff options
context:
space:
mode:
authorJames O'Gorman <james@netinertia.co.uk>2008-10-07 18:48:42 +0000
committerJames O'Gorman <james@netinertia.co.uk>2008-10-07 18:48:42 +0000
commit9f1d72462aecf47fcbe7c4f5efac855edc868b2b (patch)
tree7aade0cd5fe6e86e4c01f733198228a2e31a6938 /docs/api-docs/common/lib_common/WaitForEvent.txt
parent484050636ea8600ccbb86e73e234513fb7098778 (diff)
Documentation restructuring: part 2 of 2.
Diffstat (limited to 'docs/api-docs/common/lib_common/WaitForEvent.txt')
-rw-r--r--docs/api-docs/common/lib_common/WaitForEvent.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/api-docs/common/lib_common/WaitForEvent.txt b/docs/api-docs/common/lib_common/WaitForEvent.txt
new file mode 100644
index 00000000..0bc55726
--- /dev/null
+++ b/docs/api-docs/common/lib_common/WaitForEvent.txt
@@ -0,0 +1,16 @@
+CLASS WaitForEvent
+
+This class implements a way to efficiently wait on one or more system objects, for example sockets and file descriptors. Where kqueue() is available, this is used, otherwise poll(). The poll() implementation is less comprehensive and rather more limited.
+
+To add a compatible object, call Add(). To remove it, call Remove(). To wait for an object to become ready, call Wait(), which returns a pointer to the first ready object, or 0 for a timeout.
+
+The timeout is set either in the constructor, or using the SetTimout() method. It is specified in milliseconds.
+
+The kqueue based implementation will automatically remove objects when they are closed (actually, the OS does this), but the poll implementation requires that Remove() be called.
+
+The flags passed to Add() or Remove() are passed to the object, and are ignored by this class.
+
+For an object to be able to be added to the list, it should implement FillInKEvent() and FillInPoll() for kqueue and poll implementations respectively. Use the PLATFORM_KQUEUE_NOT_SUPPORTED define to test which is necessary for the platform.
+
+It does not have to be derived off any particular class, as it uses templates to be compatible with any class.
+