Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendMessage doesn't send (with Fix) #194

Open
Ledjlale opened this issue Jun 11, 2024 · 1 comment
Open

SendMessage doesn't send (with Fix) #194

Ledjlale opened this issue Jun 11, 2024 · 1 comment

Comments

@Ledjlale
Copy link

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

@itay-grudev
Copy link
Owner

itay-grudev commented Jun 13, 2024

If you submit a PR for this I'll accept it, but the next time I have some free time I will probably focus it on the v4.0, which gets rid of QSharedMemory.

Technically it should also be affected by this issue, so I will probably have to make sure I consider the issue there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants