Skip to content

.Net Client in UWP App (Raspberry PI2) throws HttpRequestException #3576

@fabsenet

Description

@fabsenet

I have a hub running in iis, windows server 2012, azure vm without special configuration regarding timeouts. I use a valid https certificate and windows authentication. The client is a uwp app and the error is reproducable if i run in on the desktop (win 10, 64bit) or on the raspberry pi 2 (win10 iot core)

It uses the following packages

{
  "dependencies": {
    "Microsoft.AspNet.SignalR.Client": "2.2.0",
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0",
    "Newtonsoft.Json": "7.0.1",
    "Polly": "2.2.3"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
  }
}

The .net client connects succesfully, I make some initial data exchanges using the connection. Then I make the client wait 1 minute and 3 seconds. (58 seconds works, so there must be an event around the one minute mark).

After the wait is over, I use the proxy to invoke a method on the server but I only get an instant exception:

System.Net.Http.HttpRequestException: "This IRandomAccessStream does not support the GetInputStreamAt method because it requires cloning and this stream does not support cloning."

   at System.IO.NetFxToWinRtStreamAdapter.ThrowCloningNotSuported(String methodName)
   at System.IO.NetFxToWinRtStreamAdapter.GetInputStreamAt(UInt64 position)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpHandlerToFilter.<SendAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpClientHandler.<SendAsync>d__1.MoveNext()

From there on, it looks like the connection is stuck in state "connecting". Apperently the event hubConnection.StateChanged is not invoked for the state change either. The connection never recovers.

The complete source is on github https://github.com/fabsenet/homecontrol with IotActor and Web beeing the relevant projects. In my case, the exception occurs exactly in this line: https://github.com/fabsenet/HomeControl/blob/master/IotActor/SignalrClientEndpointController.cs#L136

It feels like a bug to me 😳

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions