Not all tasks are work performed in a thread. Almost any task returned from TaskCompletionSource is something "different." And if we dig deeper into the SendTask method, we find its SentTaskCore :
private static Task<PingReply> SendTaskCore(Ping ping, object userToken, Action<TaskCompletionSource<PingReply>> sendAsync) {
So, no, it does not block the stream - it uses asynchronization completion mechanisms to avoid thread binding.
From the docs on TaskCompletionSource :
Represents the producer side of a non-delegate task, providing access to the consumer side through the Tasks property.
So, as he says, he supports the Task , which is not connected with the delegate - it allows you to pass on the Task to someone, and then organize how this task will be completed when the completion includes something other than the execution of the delegate.
source share