Which one does ioctl
of FIONREAD
return, the next packet's length, or the length of all data in the buffer?
Suppose there is a UDP
server that receives 2 packets from a client 1 and another 2 packets from client 2 after client 1's packet.
Then, what is the value of ioctl
of FIONREAD
,
and what does readfrom
return in that case?
Client 1 : v two packets
++UDP Server got 4 packets <- FIONREAD?
Client 2 : ^ two packets
FIONREAD? (server)
- length of client 1's first packet
- length of client 1's two packets
- length of client 1's two packets + client 2's two packets
- length of client 1's first packet + client 2's first packet
- other