title: Send large byte arrays between AppDomains in the same process
body: <p>I'm building a network server and starting a lot of AppDomains on the server to which requests are routed. What will be the fastest way to send off a request payload to one of the AppDomains for processing?</p>
  
  <ol>
  <li>Read in the payload from the socket into a byte array and marshal it.</li>
  <li>Marshal the network stream (inherits from MarshalByRef) to the AppDomain.</li>
  <li>Read the payload. Decode it into objects. Marshal the decoded objects.</li>
  <li>Use named pipes to transfer the byte array.</li>
  <li>Use loopback sockets.</li>
  <li>Maybe there is a way to marshal the actual socket connection?</li>
  </ol>
  
  <p>The decoding mostly creates immutable objects that are used to determine how to fulfill the clients request and the AppDomain then creates a response and marshals it back to the host AppDomain which sends it back through the socket.</p>
  
  <p>The method should prefer less memory over less CPU.</p>
  
  <p>WCF is not an option.</p>