title: Wait for server before receiving stream
body: <p>I'm trying to implement a client-server socket system based on this <a href="http://msdn.microsoft.com/en-us/library/fx6588te.aspx" rel="nofollow">MSDN article</a> and I have it working. If I do this it works fine when the server is returning a string immediately.</p>
  
  <pre><code>client.send();
  client.receive();
  </code></pre>
  
  <p>The problem is if my send method requests something that takes the server a few minutes to process, such as creating a PDF version of a file, the receive call executes straight after and receives nothing (because the server hasn't sent anything as it's still processing the PDF).</p>
  
  <p>How can I make the client wait for a certain period of time before executing the receive method so that it's called once the server has finished processing and has sent the file?</p>