X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibaxwin4.so_src%2Fipc_acessipcpipe.cpp;h=4b4bc71a0be25d1c14b4bf0f036b8b53ff4127bf;hb=145dd00e5c5a36f844be327e16a00b2983245423;hp=09cebcae0d009ccae8a1acab359829ac8a4553c2;hpb=1aed2067a0f084e9c5fa1af48e177e28a81466bc;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..4b4bc71a 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());