src/net.cpp
// Poll the connected nodes for messages
Poll the connected nodes for messages
Poll the connected nodes for messages
BOOST_FOREACH(CNode* pnode, vNodesCopy)
        {
            {
                TRY_LOCK(pnode->cs_vRecv, lockRecv);
                if (lockRecv) {
                    if (!ProcessMessages(pnode)) {
                        pnode->CloseSocketDisconnect();
                        if (pnode == pnodeSync)
                            fHaveSyncNode = false;
                    }
                }
            }
            if (fShutdown)
                return;
            {
                TRY_LOCK(pnode->cs_vSend, lockSend);
                if (lockSend)
                    SendMessages(pnode);
            }
            if (fShutdown)
                return;
        }
BOOST_FOREACH ( CNode * pnode , vNodesCopy ) { { TRY_LOCK ( pnode -> cs_vRecv , lockRecv ) ; if ( lockRecv ) { if ( ! ProcessMessages ( pnode ) ) { pnode -> CloseSocketDisconnect ( ) ; if ( pnode == pnodeSync ) fHaveSyncNode = false ; } } } if ( fShutdown ) return ; { TRY_LOCK ( pnode -> cs_vSend , lockSend ) ; if ( lockSend ) SendMessages ( pnode ) ; } if ( fShutdown ) return ; }
Poll the connected nodes for messages
Poll the connected nodes for messages
// Receive messages // Send messages