title: Serializing object ready to send over TCPClient Stream
body: <p>I've got a server and client set up using <code>TcpListener</code> and <code>TcpClient</code>.</p>
  
  <p>I want to send an object to my server application for processing.</p>
  
  <p>I've discovered the <code>using System.Runtime.Serialization</code> and the following <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.aspx" rel="noreferrer">documentation</a>, but I didn't want to faff around to find that I'm doing it in long winded way.</p>
  
  <p>The question: What is the best way to process and send an object over the TCP stream?</p>
  
  <p>Sending and receiving.</p>
  
  <p><strong>Here's an example of my object:</strong></p>
  
  <pre><code>// Create a new house to send
  house newHouse = new house();
  
  // Set variables
  newHouse.street = "Mill Lane";
  newHouse.postcode = "LO1 BT5";
  newHouse.house_number = 11;
  newHouse.house_id = 1;
  newHouse.house_town = "London";
  </code></pre>