The client code follows:
..
// filling up message
..
udpSocket.writeDatagram(message.data(), message.size(), address,port);
QByteArray message;
..
// filling up message
..
QUdpSocket udpSocket;
udpSocket.writeDatagram(message.data(), message.size(), address,port);
To copy to clipboard, switch view to plain text mode
The server code is
..
connect(&udpSocket, SIGNAL(readyRead()),
this, SLOT(processPendingDatagrams()),Qt::DirectConnection);
...
void Receiver::processPendingDatagrams()
{
while (udpSocket.hasPendingDatagrams()) {
datagram.resize(udpSocket.pendingDatagramSize());
udpSocket.readDatagram(datagram.data(), datagram.size());
}
}
..
QUdpSocket udpSocket;
connect(&udpSocket, SIGNAL(readyRead()),
this, SLOT(processPendingDatagrams()),Qt::DirectConnection);
...
void Receiver::processPendingDatagrams()
{
while (udpSocket.hasPendingDatagrams()) {
QByteArray datagram;
datagram.resize(udpSocket.pendingDatagramSize());
udpSocket.readDatagram(datagram.data(), datagram.size());
}
}
To copy to clipboard, switch view to plain text mode
I paste you the different output of ethereal on server with linux client:
No. Time Source Destination Protocol Info
..
3 0.004583 192.168.32.2 192.168.32.11 UDP Source port: 50259 Destination port: wizard
4 0.074725 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=0) [Reassembled in #17]
5 0.074845 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=1480) [Reassembled in #17]
6 0.074969 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=2960) [Reassembled in #17]
7 0.075092 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=4440) [Reassembled in #17]
8 0.075215 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=5920) [Reassembled in #17]
9 0.075338 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=7400) [Reassembled in #17]
10 0.075461 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=8880) [Reassembled in #17]
11 0.075583 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=10360) [Reassembled in #17]
12 0.075707 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=11840) [Reassembled in #17]
13 0.075830 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=13320) [Reassembled in #17]
14 0.075953 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=14800) [Reassembled in #17]
15 0.076076 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=16280) [Reassembled in #17]
16 0.076199 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=17760) [Reassembled in #17]
17 0.076258 192.168.32.11 192.168.32.2 UDP Source port: 33747 Destination port: 35147
..
No. Time Source Destination Protocol Info
..
3 0.004583 192.168.32.2 192.168.32.11 UDP Source port: 50259 Destination port: wizard
4 0.074725 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=0) [Reassembled in #17]
5 0.074845 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=1480) [Reassembled in #17]
6 0.074969 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=2960) [Reassembled in #17]
7 0.075092 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=4440) [Reassembled in #17]
8 0.075215 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=5920) [Reassembled in #17]
9 0.075338 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=7400) [Reassembled in #17]
10 0.075461 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=8880) [Reassembled in #17]
11 0.075583 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=10360) [Reassembled in #17]
12 0.075707 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=11840) [Reassembled in #17]
13 0.075830 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=13320) [Reassembled in #17]
14 0.075953 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=14800) [Reassembled in #17]
15 0.076076 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=16280) [Reassembled in #17]
16 0.076199 192.168.32.11 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=17760) [Reassembled in #17]
17 0.076258 192.168.32.11 192.168.32.2 UDP Source port: 33747 Destination port: 35147
..
To copy to clipboard, switch view to plain text mode
and windows client:
No. Time Source Destination Protocol Info
..
7 17.149508 192.168.32.2 192.168.32.12 UDP Source port: 50146 Destination port: wizard
8 17.196854 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=0)
9 17.196978 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=1480)
10 17.197100 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=2960)
11 17.197223 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=4440)
12 17.197346 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=5920)
13 17.197469 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=7400)
14 17.197592 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=13320)
15 17.197715 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=23680)
16 17.197845 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=25160)
17 17.197969 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=26640)
18 17.198091 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=28120)
19 17.198214 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=29600)
20 17.198288 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=31080)
..
No. Time Source Destination Protocol Info
..
7 17.149508 192.168.32.2 192.168.32.12 UDP Source port: 50146 Destination port: wizard
8 17.196854 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=0)
9 17.196978 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=1480)
10 17.197100 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=2960)
11 17.197223 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=4440)
12 17.197346 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=5920)
13 17.197469 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=7400)
14 17.197592 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=13320)
15 17.197715 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=23680)
16 17.197845 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=25160)
17 17.197969 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=26640)
18 17.198091 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=28120)
19 17.198214 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=29600)
20 17.198288 192.168.32.12 192.168.32.2 IP Fragmented IP protocol (proto=UDP 0x11, off=31080)
..
To copy to clipboard, switch view to plain text mode
As you can see in windows case, many IP fragments were loosed.
Bookmarks