Problem getting more than one udp packet to remote end using sendmsg()
I am trying to send data via UDP using sendmsg on the sending side, and recvfrom() on the receiving end.
The setup for my data is to have an iovec that has a packet hdr, followed by an iovec that has a payload, then to have subsequent sets of these two types of iovecs.
On the receive end, I have a while true loop that does a recvfrom() receiving a size of 1 hdr/payload combination.
When I do send out a message that has a total of just 4 iovecs (hdr/payload/hdr/payload) and I use recvfrom on the remote end
with a receive size of a hdr/payload set, only the first hdr/payload of the sendmsg is received. I was under the impression that using this
while true loop would allow me to receive multiple sets of this hdr/payload combination that is sent out by sendmsg().
My intent is to have a iovec len = to the maximum allowed size on my
sendmsg() call and to receive that data at the remote end.
Is that 2nd set of data getting dropped on the floor because I am only trying to read half of the data that was sent? If so, Is there a way that I could change the behaviour of how the data is sent out.
Thanks
|