X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibaxwin4.so_src%2Fipc_acessipcpipe.cpp;h=87cc6c9315d764ea07f6dfb70977d15163e0612e;hb=98bd9c0c8985c50c42231c116a4e18fedd47761e;hp=09cebcae0d009ccae8a1acab359829ac8a4553c2;hpb=d87b9f934993d643b193880603523dead2a63547;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libaxwin4.so_src/ipc_acessipcpipe.cpp b/Usermode/Libraries/libaxwin4.so_src/ipc_acessipcpipe.cpp index 09cebcae..87cc6c93 100644 --- a/Usermode/Libraries/libaxwin4.so_src/ipc_acessipcpipe.cpp +++ b/Usermode/Libraries/libaxwin4.so_src/ipc_acessipcpipe.cpp @@ -5,6 +5,7 @@ * ipc_acessipcpipe.c * - Acess2 /Devices/ipcpipe/ IPC Channel */ +#include "include/common.hpp" #include "include/CIPCChannel_AcessIPCPipe.hpp" #include #include @@ -33,6 +34,16 @@ bool CIPCChannel_AcessIPCPipe::HandleSelect(const fd_set& fds) { if( FD_ISSET(m_fd, &fds) ) { + ::std::vector rxbuf(4096); + size_t len = _SysRead(m_fd, rxbuf.data(), rxbuf.capacity()); + if( len == (size_t)-1 ) + throw ::std::system_error(errno, ::std::system_category()); + rxbuf.resize(len); + _SysDebug("CClient_AcessIPCPipe::HandleReceive - Rx %i/%i bytes", len, rxbuf.capacity()); + //_SysDebugHex("CClient_AcessIPCPipe::HandleReceive", rxbuf.data(), len); + + CDeserialiser msg(rxbuf); + ::AxWin::RecvMessage( msg ); } return true; } @@ -44,6 +55,8 @@ void CIPCChannel_AcessIPCPipe::Send(CSerialiser& message) throw ::std::length_error("CIPCChannel_AcessIPCPipe::Send"); } _SysDebug("CIPCChannel_AcessIPCPipe::Send(%i bytes)", serialised.size()); + //_SysDebugHex("CIPCChannel_AcessIPCPipe::Send", serialised.data(), serialised.size()); + size_t rv = _SysWrite(m_fd, serialised.data(), serialised.size()); if( rv != serialised.size() ) { throw ::std::system_error(errno, ::std::system_category());