Luga
5th June 2009, 17:41
Hi everyone!
I need to make a chat. On your site I found an example (http://wiki.qtcentre.org/index.php?title=Simple_chat). 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.?
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);
and
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);
I am sorry for my bad English. I hope you understand me. :o
I need to make a chat. On your site I found an example (http://wiki.qtcentre.org/index.php?title=Simple_chat). 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.?
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);
and
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);
I am sorry for my bad English. I hope you understand me. :o