2 * AxWin4 Interface Library
3 * - By John Hodge (thePowersGang)
6 * - Acess2 /Devices/ipcpipe/ IPC Channel
8 #include "include/CIPCChannel_AcessIPCPipe.hpp"
9 #include <system_error>
14 CIPCChannel_AcessIPCPipe::CIPCChannel_AcessIPCPipe(const char *Path)
16 m_fd = _SysOpen(Path, OPENFLAG_READ|OPENFLAG_WRITE);
18 throw ::std::system_error(errno, ::std::system_category());
22 CIPCChannel_AcessIPCPipe::~CIPCChannel_AcessIPCPipe()
26 int CIPCChannel_AcessIPCPipe::FillSelect(fd_set& fds)
32 bool CIPCChannel_AcessIPCPipe::HandleSelect(const fd_set& fds)
34 if( FD_ISSET(m_fd, &fds) )
40 void CIPCChannel_AcessIPCPipe::Send(CSerialiser& message)
42 const ::std::vector<uint8_t>& serialised = message.Compact();
43 if(serialised.size() > 0x1000 ) {
44 throw ::std::length_error("CIPCChannel_AcessIPCPipe::Send");
46 _SysDebug("CIPCChannel_AcessIPCPipe::Send(%i bytes)", serialised.size());
47 size_t rv = _SysWrite(m_fd, serialised.data(), serialised.size());
48 if( rv != serialised.size() ) {
49 throw ::std::system_error(errno, ::std::system_category());