Commit 3a16d69d authored by Thiago C. Santini's avatar Thiago C. Santini

Tests socket before pushing

parent f232bb6f
......@@ -30,7 +30,7 @@ void NetworkStream::onThreadFinishing()
if (connected)
socket->deleteLater();
} else if (settings.value("dataStream/transportProtocol").toString().compare("UDP", Qt::CaseInsensitive) == 0) {
delete socket; socket;
delete socket;
}
qDebug() << QThread::currentThread()->objectName() << " done.";
}
......@@ -62,6 +62,9 @@ void NetworkStream::closeSocket()
void NetworkStream::push(JournalEntry journalEntry)
{
if (!socket)
return;
if (settings.value("dataStream/transportProtocol").toString().compare("TCP", Qt::CaseInsensitive) == 0) {
if (connected)
socket->write(journalEntry.toQString().prepend("J").toStdString().c_str());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment