title: Strategy for Dealing with 64bit/32bit when transferring Binary data between Machines via TCP/IP
body: <p>I've been working on a project where I need to transfer large volumes of Binary data some are Structs, enums, lists etc and some are pure binary data, I'm trying to develop a strategy for dealing with the issues when transferring the data between a 64bit compile and a 32bit compile.</p>
  
  <p>Presently I mark the assembly to just target 32bit to avoid the issue, but I want to open up and use the 64bit/32bit by targetting Any.</p>
  
  <p>I know I "could" use serialization, but this adds quite a lot of additional data to the transfer and because these transfers can travel across VPN etc, it was decided to Not use pure .Net serialization due to the additional overhead added.</p>
  
  <p>Therefore when you do this process would it be best to:</p>
  
  <ol>
  <li>Add 1 Byte to EACH Block of data that is transferred specifying the bitsize that was used to encode the data on the initial end</li>
  <li>Add 1 Byte that is used in the Initial Handshake between the systems to specify the bitsize that will be used for all communication</li>
  <li>Don't use default datatypes (integer, short, etc) and instead Encode them in the data so that the transfer is not dependent upon System varying datatype sizes.</li>
  </ol>