locked
connection.Start taking longer than 4 minutes RRS feed

  • Question

  • User-314857674 posted

    Hello folks,

    I want to use SignalR in a WindowsService and have clients on other machines as Console/WPF Apps.

    It is working perfectly with Client at localhost. If I try to connect over IP address or DNS Name the connection needs 4 minutes to get  connected.

    There is a problem with Start not returning for 4 minutes. I turned tracing on already. Here is a screenshot of the tracing:

    Client Connecting Trace

    As you can see it takes 4 min. I have the same Problem in Release Build Configuration and I run VS2015 as administrator on a Win 7 Pro x64 machine, Firewall turned off.

    I can reproduce the problem with this example solution http://www.codeproject.com/Articles/804770/Implementing-SignalR-in-Desktop-Applications and just change the clients connection URL from localhost to the IP address. Different ports have the same  behaviour

    After the long connection time everything is working good without long delays. I tried it with SignalR 2.0.3, 2.1.1 and 2.2.1.

    I also embedded the SignalR 2.1.1 SourceCode and analysed the issue in the SignalR.Client sources.

    At this line the debugger does not return for the 4 minutes:

                    return Task.Factory.FromAsync<HttpWebResponse>(request.BeginGetResponse, ar => (HttpWebResponse)request.EndGetResponse(ar), null);

    in Method public static Task<HttpWebResponse> GetHttpResponseAsync(this HttpWebRequest request) in HttpHelper.cs

    Can anybody help me what is wrong?

    Thursday, September 1, 2016 11:01 PM

All replies

  • User61956409 posted

    Hi cellz,

    According to the logs, as you said, we could find that it takes about 4mins to connect to hub. I’d like to know if same issue appears at each time the client establishs connection to hub and if it will take a long time to broadcast message to clients. Besides, please make sure if network environment is fine.

    Best Regards,

    Fei Han

    Friday, September 2, 2016 9:05 AM