Skip to content

SendMessage doesn't send (with Fix) #194

@Ledjlale

Description

@Ledjlale

Hi
The Qt6's specs set -1 as a value of waitForReadyRead() : https://doc.qt.io/qt-6/qiodevice.html#waitForReadyRead

As for https://github.com/itay-grudev/SingleApplication/blob/master/singleapplication_p.cpp#L324
The msecs can be negative and different than -1 (coming from static_cast(msecs - time.elapsed()) )

The result is that at random, the function doesn't wait and return false. That lead to not send the message.

The proposition is to replace the call by :
bool result = socket->waitForReadyRead( msecs < 0 ? -1 : msecs );

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions