pelican/output/src/TCPConnectionManager.cpp
/**
 * @details
 * Send dataSupport Information to connected clients
 */
@details
Send dataSupport Information to connected clients
@details Send dataSupport Information to connected clients
void TCPConnectionManager::_sendNewDataTypes()
{
    DataSupportResponse res( types() );
    clients_t clientListCopy;
    {
        QMutexLocker locker(&_mutex);
        clientListCopy = _clients[_dataSupportStream];
    }
    for(int i = 0; i < clientListCopy.size(); ++i ) {
        QTcpSocket* client =  clientListCopy[i];
        try {
            Q_ASSERT( client->state() == QAbstractSocket::ConnectedState );
            _protocol->send(*client, res);
            client->flush();
        }
        catch ( ... )
        {
            std::cerr <<  "TCPConnectionManager: failed to send data to client" << std::endl;
            _killClient(client);
        }
    }
}
void TCPConnectionManager :: _sendNewDataTypes ( ) { DataSupportResponse res ( types ( ) ) ; clients_t clientListCopy ; { QMutexLocker locker ( & _mutex ) ; clientListCopy = _clients [ _dataSupportStream ] ; } for ( int i = 0 ; i < clientListCopy . size ( ) ; ++ i ) { QTcpSocket * client = clientListCopy [ i ] ; try { Q_ASSERT ( client -> state ( ) == QAbstractSocket :: ConnectedState ) ; _protocol -> send ( * client , res ) ; client -> flush ( ) ; } catch ( ... ) { std :: cerr << " " << std :: endl ; _killClient ( client ) ; } } }
@details
 Send dataSupport Information to connected clients
@details Send dataSupport Information to connected clients
// control access to the _clients // iterate over all clients subscribed to the data support channel // Send data to client //std::cout << "Sending to:" << client->peerName().toStdString() << std::endl; //std::cerr <<  "TCPConnectionManager: sending newdata types to client" << std::endl; // kill the client if anything goes wrong