How to determine which transport method Signal R is using

Regarding the transport method:

You can inspect HubCallerContext.QueryString param transport:

public void SendLongRunning(string name, string waitFor)
{
    var transport = Context.QueryString.First(p => p.Key == "transport").Value;
}

Regarding threading & long-running tasks:

Each request will be handled on a separate thread and the hub pipeline resolves the client-side promise when the hub method completes. This means that you can easily block your connection because of the connection limit in browsers (typically 6 connections at a time).

E.g.: if you use long-polling and you make six requests to the server, each triggering (or directly executing) a long-running operation, then you'll have six pending AJAX requests which only get resolved once the hub method is done, and you won't be able to make any further requests to the server until then. So you should use separate tasks for the long-running code and you should also not await those so the hub dispatcher can send its response without a delay.

If the client needs to know when the long-running task is done, then you should do a push notification from the server instead of relying on the .done() callback.