Example #1
0
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
bool MsgMgr::addCommNodeToChannel(ChannelId _channelId, CommNode * _commNode)
{
    ASSERT(_commNode);

    bool bRet = false;

    ASSERT(_channelId != InvalidChannelId);
    if(_channelId != InvalidChannelId)
    {
        {
            NWAutoCritSec critSec(mCritSecAddRemoveCommNodes);

            MsgChannel * channel = mChannelList->getChannel(_channelId);
            ASSERT(channel);
            if(channel)
            {
                MsgChannel * commNodeChannel = _commNode->getLocalChannel();
                channel->listenTo(commNodeChannel);
                commNodeChannel->listenTo(channel);
                bRet = true;
            }
        }
    }

    return bRet;
}