title: Serialize and send a data structure using Boost?
body: <p>I have a data structure that looks like this:</p>
  
  <pre>
  typedef struct
  {
    unsigned short m_short1;
    unsigned short m_short2;
    unsigned char m_character;
  } MyDataType;
  </pre>
  
  <p>I want to use boost::serialization to serialize this data structure, then use boost::asio to transmit it via TCP/IP, then have another application receive the data and de-serialize it using the same boost libraries.</p>
  
  <p><A HREF="http://www.boost.org/doc/libs/1_38_0/libs/serialization/doc/tutorial.html" rel="noreferrer">I'm trying to following boost::serialization tutorial</A>, (<A HREF="http://stackoverflow.com/questions/523872/how-do-you-serialize-an-object-in-c">as some other SO questions have suggested</A>) but the example is specifically for writing/reading to a file, not to a socket using boost::asio.</p>
  
  <p>I'm pretty sure I've got the right tools for the job -- I just need help making them work together.  Writing to a socket can't be that different from writing to a file, right?</p>
  
  <p>Any suggestions are very much appreciated.  Thanks!</p>