Channel* DispatcerIPCEventHandler::GetServiceProcessIPCChannel( ServiceType type, ServiceIndex idx) { ProcessAddress addr; addr.proc_type = type; addr.proc_idx = idx; IPCChannelTable::iterator tit = m_ipc_channel_table.find(addr); if (tit != m_ipc_channel_table.end()) { Channel* ch = tit->second; DispatcherProcess* dispatchProc = static_cast<DispatcherProcess*>(g_service_proc); if (dispatchProc->GetIPCType() == IPC_FIFO) { if (!ch->IsWriteReady()) { ch->Open(); if (!ch->IsWriteReady()) { return NULL; } } } return ch; } return NULL; }
void ServiceProcess::CheckDispatcherIPCChannelTable() { IPCChannelTable::iterator it = m_dispacher_ipc_channels.begin(); while (it != m_dispacher_ipc_channels.end()) { Channel* ch = it->second; if (!ch->IsWriteReady()) { ch->Open(); } it++; } }
Channel* ServiceProcess::GetDispatcherIPCChannel(uint32 index) { ProcessAddress proc_addr(DISPATCHER_SERVICE_PROCESS_TYPE, index); IPCChannelTable::iterator it = m_dispacher_ipc_channels.find(proc_addr); if (it != m_dispacher_ipc_channels.end()) { Channel* ch = it->second; if (!ch->IsWriteReady()) { ch->Open(); if (!ch->IsWriteReady()) { return NULL; } } return ch; } return NULL; }