shill: Add "IO Ready" handler
For output sockets and for non-traditional "input" events we
need to trigger when an fd is ready, but we don't want GLib
to be in charge of the IO itself. For this, we create a
"ready handler" which triggers a callback which is passed the
file descriptor which is ready.
BUG=chromium-os:21664
TEST=New unit tests
Change-Id: I4960658e6d0940d8db65ae6f77ff09679b3ef96a
Reviewed-on: http://gerrit.chromium.org/gerrit/10327
Reviewed-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/io_handler.h b/io_handler.h
index 74c34b9..97e0089 100644
--- a/io_handler.h
+++ b/io_handler.h
@@ -17,8 +17,16 @@
class IOHandler {
public:
+ enum ReadyMode {
+ kModeInput,
+ kModeOutput
+ };
+
IOHandler() {}
virtual ~IOHandler() {}
+
+ virtual void Start() {}
+ virtual void Stop() {}
};
} // namespace shill