Exemplo n.º 1
0
void MainWindow::disconnectFromDisplayCluster()
{
    if(g_dcSocket != NULL)
    {
        dcStreamDisconnect(g_dcSocket);
        g_dcSocket = NULL;
    }
}
Exemplo n.º 2
0
bool sendSVGToDisplayCluster(std::string filename, std::string name)
{
    if(g_dcSocket == NULL || g_dcSocket->state() != QAbstractSocket::ConnectedState)
    {
        put_flog(LOG_ERROR, "error sending SVG stream, socket not connected");

        dcStreamDisconnect(g_dcSocket);
        g_dcSocket = NULL;

        QMessageBox messageBox;
        messageBox.setText("Lost connection to DisplayCluster.");
        messageBox.exec();

        return false;
    }

    // open file corresponding to URI
    QFile file(filename.c_str());

    if(file.open(QIODevice::ReadOnly) != true)
    {
        put_flog(LOG_ERROR, "could not open file %s", filename.c_str());
        return false;
    }

    QByteArray imageData = file.readAll();

    bool success = dcStreamSendSVG(g_dcSocket, name, imageData.constData(), imageData.size());

    if(success != true)
    {
        put_flog(LOG_ERROR, "error sending SVG stream");
    }

    return success;
}
Exemplo n.º 3
0
void ImageStreamer::disconnect()
{
    dcStreamDisconnect( dcSocket );
    dcSocket = 0;
}
Exemplo n.º 4
0
ImageStreamer::~ImageStreamer()
{
    dcStreamDisconnect( dcSocket );
}