locked
Can't connect to self-hosted SignalR Server on Windows Server 2012 RRS feed

  • Question

  • User-2079308094 posted

    Hi

    I was working through the tutorials and trying out the sample applications.

    For example the self-hosted wpf sample found here https://code.msdn.microsoft.com/Using-SignalR-in-WinForms-f1ec847b

    When I start the server application on a windows 7 machine and try to connect to it from another windows 7 machine in the LAN it works just fine.

    But when I do the same on a Windows Server 2012 OS I can't connect to it. Even though the server starts without any exception.

    On the client side the call:

    await Connection.Start();

    Throws a HTTPRequestException with an Inner Exception "System.Net.WebException" with an Inner Exception "System.Net.Sockets.SocketException".

    With a StackTrace   

       bei System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
       bei System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

    The Server is a virtual machine and sits inside the LAN just like the windows 7 machine (which worked). I tried to establish the connection with computer name or IP adress, but on the Windows Server OS both won't work.

    When I start the server and the client application both on the windows Server with localhost it actually works. I just can't connect from outside. I already allowed the app through the firewall.

    Any idea what I might be doing wrong or what else I can try?

    Best Regards,

    Ric

    Wednesday, April 8, 2015 2:54 AM

Answers

  • User-2079308094 posted

    I finally managed to establish a connection.

    The problem was, that in the windows firewall I made a inbound rule for the server application.

    Now removed this rule and made a new rule just for that specific port and now I can connect.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 30, 2015 2:18 AM

All replies

  • User1711366110 posted

    But when I do the same on a Windows Server 2012 OS I can't connect to it. Even though the server starts without any exception

      As per your case, Check the details below :

     Browsers will support it because they have implemented the protocol internally, most browsers won't use the operating system transport libraries so they will be able to make use of WebSockets even if the OS does not directly support it.

    HTTP.SYS prior to Windows 8/2012 has no built in support for WebSockets, so although .NET 4.5 contains WebSocket classes, they won't work unless you are running .NET 4.5+ on Windows 8/2012 and that will affect self-hosting solutions running in Windows < 8.

    Click here to refer the similar thread which explains the self-hosted SignalR Server on Windows Server 2012

    --
    with regards,
    Edwin

    Thursday, April 9, 2015 12:53 AM
  • User-2079308094 posted

    Thanks for your answer.

    I am not sure if I understand you correctly. From my perception you say that prior to Windows 8/2012 I have no support for WebSockets. After that I have this support.

    But I experience the opposite. I can connect to a server that is self-hosted on Windows 7. But if I connect to a server that is self-hosted on a Windows Server 2013 machine, I cannot connect to it.

    And when I check the supported platforms:

    http://www.asp.net/signalr/overview/getting-started/supported-platforms#updates

    I should be able to connect to my Windows Server 2012

    Please correct me if I'm wrong

    Thursday, April 9, 2015 2:15 AM
  • User-2079308094 posted

    I was working on other projects for the past weeks and now I wanted to come back to this topic.

    But as before I can't connect to the service when i self host it on a windows server. Can anyone try to reproduce the problem?

    I want to know if I am doing something wrong, or if it is just not possible to self host on windows server.

    If not, I would have to rewrite my windows-service application.

    Monday, April 27, 2015 11:15 AM
  • User760824056 posted

    Similar scenario.  I have a Windows 7 machine  with a self-hosted server and a client, on the same machine, which will not connect.   No errors thrown, just no connection.   I'm using SignalR version 2.20 for this project, I haven't used it in a while and never used to have any issues, at least like this.  I think I may revert back to an earlier version and see what happens.

    Tuesday, April 28, 2015 4:19 PM
  • User-2079308094 posted

    I finally managed to establish a connection.

    The problem was, that in the windows firewall I made a inbound rule for the server application.

    Now removed this rule and made a new rule just for that specific port and now I can connect.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 30, 2015 2:18 AM