title: Is there a "nice" way to deal with reassembling multicasts from multiple sources?
body: <p>I'm currently reworking our existing proprietary socket wrapper code to use boost asio so that it can do some of the heavy lifting for us.  Perhaps the most complex area of our existing code is the multicast handling code.   The code allows our middle-tier servers (of which there can me many in one system) to send multicasts to client boxes, which use these to present updates to the users of the system.</p>
  
  <p>The reason the code is complex and error-prone is that it uses a number of raw buffers to reassemble the multicast streams according to where they have come from.  It appears that even with Boost.Asio I'm going to have to deal with this same issue, so before I get stuck in I thought it would be worth asking how other people have dealt with this situation.</p>
  
  <p>It seems like a very common use-case. Is there anything out there that can help me do this job without the kind of code I have now?  Or is there an established C++ template (Boost or otherwise) that can do this kind of work?</p>
  
  <p>Obviously I could make things easier on myself and use STL containers to buffer the packets instead of raw arrays, but this code needs to be really high performance.  On large installs there are a huge number of packets flying around and it needs to respond as near to real time as possible.</p>
  
  <p>Thanks in advance for any thoughts on this matter.</p>
  
  <p>Jamie</p>