title: How to return a value from a c# SignalR client
body: <p>I have a hub that manages many worker processes. I want to build a UI that lets me connect to this hub and retrieve the processing log from any of these worker processes. Essentially this will be a client wanting to obtain a string from another client. I have been able to get the request from client A sent to client B, but i dont know how to return anything in that response. </p>
  
  <p>I have a simple method in the hub</p>
  
  <pre><code>public void GetRunLog(int runid)
  {
      JobRunLog log = null;
      JobRunClient client = this.GetClientByRunID(runid);
      if(client != null)
      {
          var rawlog = Clients.Client(client.ConnectionID).GetRunLog();
          log = JsonConvert.DeserializeObject&lt;JobRunLog&gt;(rawlog);
          Clients.Client(Context.ConnectionId).GetRunLog(log);
      }
  }
  </code></pre>
  
  <p>This request gets picked up by the client, but I dont know how to make it return a value so that <code>var rawlog</code> actually contains something. For the moment, this is the best workaround i could come up with.</p>
  
  <pre><code>myHubProxy.On("GetRunLog", (uiconnectionid) =&gt;
  {
      string connectionid = uiconnectionid;
      myHubProxy.Invoke("ReturnRunLog", run.ID, run.Log, connectionid).ContinueWith(task =&gt; {});
  });
  </code></pre>
  
  <p>This will then make the worker client send the log back in a separate request with a reference to the client that had requested the log, but it isnt actually returning a respnonse to the initial request. I cant see a way to make this happen. Rather than use Invoke, how would i just return the object directly to the method on the hub that initiated the request?</p>