title: WCF call a function without waiting for it to finish its job?
body: <p>In the client side every time I call a function from my WCF service, it waits until the function is complete at the WCF Service, like calling a local function.  So I added an extra function for each one that starts the intended function in a new thread, so that almost all my function are like this:</p>
  
  <p><strong>EX:</strong><br>
  I call a function from <strong>CLIENT</strong> side <code>client.ReceiveFile()</code> :</p>
  
  <pre><code>private void SendFile(Socket socket, Job job, DoWorkEventArgs e)
      {
          UpdateInfo(job.Name, job.Icon, job.Size);
          client.ReceiveFile((_File)job.Argument, bufferSize);
          SizeAll = job.Size;
          UpdateCurrFile(((_File)job.Argument).Path, "1");
          SendX(socket, ((_File)job.Argument).Path, e);
      }
  </code></pre>
  
  <p>In the the server I have to do it this way:</p>
  
  <pre><code> public void ReceiveFile(_File file, int bufferSize)
      {
          System.Threading.Thread th = new System.Threading.Thread(unused =&gt; ReceiveFileTh(client, file.Name, file.Size, bufferSize));
          th.Start();
      }
      private void ReceiveFileTh(Socket client, string destPath, long size, int bufferSize)
      {
          try
          {
              ReceiveX(client, destPath, size, bufferSize);
          }
          finally
          {
              CloseClient();
          }
      }
  </code></pre>
  
  <p>The point is, when I sendFile from client, it tells the service to start receiving, but if I didn't start a new thread, the client will wait for the service to receive the file, and will not send the file data.</p>
  
  <p>So does WCF support a way that doesn't make the client wait for the service function to be done! or I will have to use the above method?</p>