Hi everyone!
I need to make a chat. On your site I found an example. But there's no list of participants. How can I do?
Do I understand that the data on a server need to send in that format?
And if the server receives GRTNG, it verifies the existence of party with the same name and save it.?
out <<quint16
(0) <<
QString("GRTNG") << nick
->text
();
out.device () -> seek (0);
out <<quint16 (arrBlock.size () - sizeof (quint16));
socket-> write (arrBlock);
QByteArray arrBlock;
QDataStream out (& arrBlock, QIODevice:: WriteOnly);
out.setVersion (QDataStream:: Qt_4_5);
out <<quint16 (0) << QString("GRTNG") << nick->text ();
out.device () -> seek (0);
out <<quint16 (arrBlock.size () - sizeof (quint16));
socket-> write (arrBlock);
To copy to clipboard, switch view to plain text mode
and
out <<quint16
(0) <<
QString("MSG") << message
->text
();
out.device () -> seek (0);
out <<quint16 (arrBlock.size () - sizeof (quint16));
socket-> write (arrBlock);
QByteArray arrBlock;
QDataStream out (& arrBlock, QIODevice:: WriteOnly);
out.setVersion (QDataStream:: Qt_4_5);
out <<quint16 (0) << QString("MSG") << message->text ();
out.device () -> seek (0);
out <<quint16 (arrBlock.size () - sizeof (quint16));
socket-> write (arrBlock);
To copy to clipboard, switch view to plain text mode
I am sorry for my bad English. I hope you understand me.
Bookmarks