Send data between processes via QSharedMemory
-
Hi and welcome to devnet,
Did you see that you are not using the same key for both applications ?
For the Qt application you are using backslashes and for the WinAPI application your are using forward slashes.
-
Hi and welcome to devnet,
Did you see that you are not using the same key for both applications ?
For the Qt application you are using backslashes and for the WinAPI application your are using forward slashes.
-
I don't remember if there's a limitation in the characters you can use as key, but i'd start with only ASCII stuff without any special signs.
-
What exact error are you getting ?
-
I don't remember if there's a limitation in the characters you can use as key, but i'd start with only ASCII stuff without any special signs.
-
Probably off topic, but did you consider using QLocalSocket and WINAPI Named Pipe instead
-
Probably off topic, but did you consider using QLocalSocket and WINAPI Named Pipe instead
-
Disclaimer
what follows is just speculation, not advice.
The problem with shared memory, as I understand it, is that is no way to signal the reader application that new data is available to consume.
10 MBit/s is not a lot, named pipe should be able to manage it without a problem, in fact, a TCP socket connected to localhost should also be able to handle that transfer rate without a sweat. Both their typical transfer rates are in the multiple Gbit/sec
-
Check the detailed documentation of QSharedMemory and the setNativeKey. They explain how to achieve communication with non Qt application.
-
@SGaist When I run two copies of Ot application and write some data to shared memory from one of them and the next trying read data from another I have problem: sharedMemory.isAttached() == FALSE for shared memory with same keys.
-
Disclaimer
what follows is just speculation, not advice.
The problem with shared memory, as I understand it, is that is no way to signal the reader application that new data is available to consume.
10 MBit/s is not a lot, named pipe should be able to manage it without a problem, in fact, a TCP socket connected to localhost should also be able to handle that transfer rate without a sweat. Both their typical transfer rates are in the multiple Gbit/sec
-
@MR.Smith Didn't you say before that it is working when using two Qt apps and doesn't work if one app is not a Qt app?
-
@jsulm Yes, it's true. I can transfer data from one Qt application to another copy of this Qt application, but I can't transfer data from Qt application to WinAPI application.