From cc4e81423aaec148b97ab0df553fef39cd3bc7f5 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Date: Tue, 27 May 2014 07:39:29 +0200 Subject: [PATCH] JsonRPC4NET: weird behaviour under WindowsPhone8 await HttpClient.PostAsync returns results in the main thread, it seems as if it is not spawning new thread --- jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs b/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs index fc93ee3..aeee6fa 100644 --- a/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs +++ b/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs @@ -112,6 +112,8 @@ namespace GumartinM.JsonRPC4NET // For HttpResponseMessage response I am sure I have to do it but I am not for HttpContent content. using (HttpClient client = new HttpClient { Timeout = TimeSpan.FromSeconds(5) }) using (HttpContent contentPOST = new StringContent(jsonData, System.Text.Encoding.UTF8, "application/json-rpc")) + // TODO: in WindowsPhone 8 client.PostAsync does not seem to spawn new thread :/ WTF + // Using WindowsPhone 8 the result is returned in the same thread!!!!! WTF using (HttpResponseMessage response = await client.PostAsync(uri, contentPOST, cancellation)) //TODO: What if response is null? :( using (HttpContent contentRESULT = response.Content) -- 2.1.4