Usermode/AxWin4 - Starting work on client-side library
[tpg/acess2.git] / Usermode / Libraries / libaxwin4.so_src / ipc_acessipcpipe.cpp
diff --git a/Usermode/Libraries/libaxwin4.so_src/ipc_acessipcpipe.cpp b/Usermode/Libraries/libaxwin4.so_src/ipc_acessipcpipe.cpp
new file mode 100644 (file)
index 0000000..b7a509c
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * AxWin4 Interface Library
+ * - By John Hodge (thePowersGang)
+ *
+ * ipc_acessipcpipe.c
+ * - Acess2 /Devices/ipcpipe/ IPC Channel
+ */
+#include "include/CIPCChannel_AcessIPCPipe.hpp"
+#include <system_error>
+#include <cerrno>
+
+namespace AxWin {
+
+CIPCChannel_AcessIPCPipe::CIPCChannel_AcessIPCPipe(const char *Path)
+{
+       m_fd = _SysOpen(Path, OPENFLAG_READ|OPENFLAG_WRITE);
+       if( m_fd == -1 ) {
+               throw ::std::system_error(errno, ::std::system_category());
+       }
+}
+
+CIPCChannel_AcessIPCPipe::~CIPCChannel_AcessIPCPipe()
+{
+}
+
+int CIPCChannel_AcessIPCPipe::FillSelect(fd_set& fds)
+{
+       FD_SET(m_fd, &fds);
+       return m_fd+1;
+}
+
+bool CIPCChannel_AcessIPCPipe::HandleSelect(const fd_set& fds)
+{
+       if( FD_ISSET(m_fd, &fds) )
+       {
+       }
+       return true;
+}
+
+void CIPCChannel_AcessIPCPipe::Send(CSerialiser& message)
+{
+       // TODO:
+}
+
+
+};     // namespace AxWin
+

UCC git Repository :: git.ucc.asn.au