Skip to content

Conversation

@VergilYotov
Copy link

In v4.0 the objective is to use QLocalSocket for not only for inter-instance communication, but for proof of being the primary instance. Only one instance at a time can be the QLocalServer which is what I am using as the proof of primary instead of QSharedMemory.

We also make Qt6 the default.

There are several important considerations. As we will now rely on prompt responses from theQLocalServer it needs to run in a separate thread, to ensure the application doesn't block it from responding to messages.

I also want to remove the stateful messages, which were added as a fix in 3.0.

Instead all messages are encoded/decoded through the MessageCoder class which uses QDataStream and directly attaches to the socket data stream. When we parse the message from the socket, if the parse fails, we skip over one byte and try again until we succeed. This ensures even if the data is garbled we will eventually parse the next message.

I kind of wanted a more self-contained message interface hence the SingleApplicationMessage class, but I couldn't figure out how to fit it in.

There are a lot of TODOs with code that needs to be implemented and stubbed functions.

@itay-grudev itay-grudev marked this pull request as draft August 8, 2024 10:33
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

Successfully merging this pull request may close these issues.

2 participants