X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2FCClient.cpp;h=6c9fe685a678202d58615c3b8e8ee3271fc19ef9;hb=5b487e31cf5145372e9777e9f82a8cd661d4f1b4;hp=6f1f2562aaa89998b194b3168255b5b417ba6142;hpb=340e7923b1e95c39ac85a4b22af7f1b53b315cd9;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/CClient.cpp b/Usermode/Applications/axwin4_src/Server/CClient.cpp index 6f1f2562..6c9fe685 100644 --- a/Usermode/Applications/axwin4_src/Server/CClient.cpp +++ b/Usermode/Applications/axwin4_src/Server/CClient.cpp @@ -6,33 +6,58 @@ * - IPC Client */ #include +#include +#include namespace AxWin { -CClient::CClient(IIPCChannel& channel): +CClient::CClient(::AxWin::IIPCChannel& channel): m_channel(channel) { } +CClient::~CClient() +{ + ::AxWin::IPC::DeregisterClient(*this); +} + CWindow* CClient::GetWindow(int ID) { - if( ID == 0 ) - return 0; - - return m_windows[ID]; + try { + return m_windows.at(ID); + } + catch(const std::exception& e) { + return NULL; + } } void CClient::SetWindow(int ID, CWindow* window) { + _SysDebug("SetWindow(ID=%i,window=%p)", ID, window); if( m_windows[ID] ) { delete m_windows[ID]; } m_windows[ID] = window; } -void CClient::SendMessage(CSerialiser& reply) +void CClient::HandleMessage(CDeserialiser& message) { + try { + IPC::HandleMessage(*this, message); + if( !message.IsConsumed() ) + { + _SysDebug("NOTICE - CClient::HandleMessage - Trailing data in message"); + } + } + catch( const ::std::exception& e ) + { + _SysDebug("ERROR - Exception while processing message from client: %s", e.what()); + } + catch( ... ) + { + _SysDebug("ERROR - Unknown exception while processing message from client"); + } } }; // namespace AxWin