My project requires writing a UDP server in Qt for NonQt clients.
In examples I read all are tell how to implement server and client both in Qt.
Please guide me how to go about.
My project requires writing a UDP server in Qt for NonQt clients.
In examples I read all are tell how to implement server and client both in Qt.
Please guide me how to go about.
we wont do your homework...
requires writing a UDP server in Qt for NonQt clients.
In examples I read all are tell how to implement server and client both in Qt.
Please guide me how to go about.Isn't UDP server telling by its own that the server and the client coresponding via UDP? And I have never heard that UDP is Qt only.
In the implementation of server by QUdpSocket based examples we are creating ByteArray buffer object, then use QDataStream device object with write only and passing the ByteArray, then we are setting version of QDataStream, then use << operator to send the data which is of type double to the ByteArray buffer. Then we are calling the writedatagram by passing ByteArray buffer, host address and port number.
The doubt to be clarified (not to do my homwork) is will a non qt application understand the byte order done by QDataStream? Thanks in advance.
Well, since your other program will be receiving the data anyway, why not just try? You will quickly work out if you can parse the packets or whether you need to design your own QDataStream.
We wrote the functions to write each type of the data(both common type and struct) in to a charArray in terms of the bytes based on pointer arithmetics.
Use the Qt Udp function calls which takes char Array and its size.
The Program worked fine.
For confirming the data is sent or not we used the tcpdump utility.
Thanks a lot.
Bookmarks