QLocalSocket separate multiple messages
Unsolved
General and Desktop
-
Hi. I use QLocalSocket in windows. Named pipes in WIndows can send separate messages except raw byte array. Is QLocalSocket have something like this? Or maybe is Qt have classes for pack/unpack separate msg with different size to byte array?
@Mefil
Hello and welcome.I don't really know what you have in mind. But
QLocalSocket
behaves just like a socket. It is not message-oriented, it is just a stream of bytes.You can impose whatever of your own protocol on top if you wish, e.g. precede a "message" you want to send with a byte count. If both ends are using Qt you can use
QDataStream
to "pack/unpack" structured data.