title: How do I use the k() function to receive data in kdb/q
body: <p>Using the c.cs interface found in <a href="http://code.kx.com/q/interfaces/csharp-client-for-q/" rel="nofollow noreferrer">Interfacing with C#</a>, how do I use the <code>k()</code> function to receive data from a long-running computation?</p>
  
  <p>What I would like to do is</p>
  
  <pre><code>conn.ks("compute_long_running_function[]");
  </code></pre>
  
  <p>Do something else</p>
  
  <pre><code>results=conn.k();//wait for data
  </code></pre>
  
  <p>However, this latter call does not return the last result -- it times out indefinitely unless <code>/T {N}</code> has been set beforehand.</p>
  
  <p>Is there a way to send data from the server to the client that is waiting for it?  How else would one use the <code>k()</code> function with no arguments.</p>
  
  <p>Note that this question also applies to the java interface, which is nearly identical.</p>