Il 02/01/2012 16:00, Abdelrazak Younes ha scritto:
I'll have a look, thanks. Another immediate question is whether
there's any portable serialization framework already at reach for LyX
(i.e., in terms of dependencies -- e.g., I could identify
boost::serialize::archive & related). That may be useful to serialize
FuncRequest objects, as well as other types of messages that may be
worth to be transmitted through the socket(s).
IIRC, quite some time ago, Lars wanted to use this boost serialiser,
try to look in the archives for "serialize any", or something.
I just discovered QDataStream, which I'd guess fits better with
QTcpSocket. For example:
QByteArray message;
QDataStream ds(&messagae, QIODevice::WriteOnly);
ds << this;
ds << that;
tcpSocket.write(message);
--
MyServer::readyRead () {
QByteArray message = tcpSocket.readAll();
[... usual mess for incomplete reads...]
QDataStream ds(&messagae, QIODevice::ReadOnly);
ds >> this;
ds >> that;
}
I'm not sure about what comes out if we mix QTcpSocket with boost
archives & serialization library, but I doubt it would be so compact.
T.