title: Receive many datagrams from several hosts using winsock
body: <p>I am developing an application that distributes rendering across several devices (a university project).</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>I have looked at WSARecv and WSARecvFrom but neither seems to be able to receive several packets from several hosts.</p>
  
  <p>Thanks in advance :)</p>
  
  <p><H3>EDIT</H3>
  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.</p>
  
  <p>Fetching several packets would be nice to try out too, anyone knows how to do that?</p>