Dear stackers.
I am developing an application that distributes rendering across several devices (a university project).
Each frame consists of several blocks (16x16 pixels), and each device is "assigned" a number of blocks to be rendered. These blocks, when rendered, are compressed and serialized into a buffer until the max size of this is reached, at which point it will be sent.
My problem is on the receiving end, which needs to recieve several datagrams per frame from several devices. Currently I call recv for each packet, but this requires a context switch for each packet. It would be better to receive many packets with one call. A packet identify which client it is from, so the addresses of these are irrelevant.
I have looked at WSARecv and WSARecvFrom but neither seems to be able to receive several packets from several hosts.
Thanks in advance :)
EDIT
Using a separate thread to fetch packets from the OS layer does not seem to improve the situation. In fact the solution proposed by Amardeep has a performance that is lower than the previous scheme.Fetching several packets would be nice to try out too, anyone knows how to do that?