SignalR Fails with more than 2 connections

前端 未结 1 1779
不思量自难忘°
不思量自难忘° 2021-01-13 07:57

I have written a fairly simple chat application in SignalR.

It seems if i connect with more than 2 tabs/browsers/devices the third will hang and never connect and ev

相关标签:
1条回答
  • 2021-01-13 08:13

    I believe I was able to discover the answer to this after much hair pulling out and frustration.

    Because desktop IIS only allows 10 concurrent connections and websocket connections are so dynamic I think that it was acting as 10 connections with only 2 actual connections. http://www.asp.net/signalr/overview/getting-started/supported-platforms

    "full versions of IIS or Cassini should not be used, since there will be a limit of 10 simultaneous connections imposed, which will be reached very quickly since connections are transient, frequently re-established, and are not disposed immediately upon no longer being used. IIS Express should be used on client operating systems."

    If that is not the case then someone please correct me!

    As a work around I am going to use IIS Express, my reasoning behind not wanting to was becauase I wanted my site exposed so my co-workers could connect and sanity test. I figured out how to expose IIS to the web and run it from a command prompt so I can develop while the server is up. This is how to expose IIS Express Go to c:\Users[YourName]\Documents\IISExpress\config\applicationhost.config

    Add(replacing IP address and port appropriately):

    <binding protocol="http" bindingInformation="*:58938:192.168.1.42" />
    

    To the relevant site.

    Running IIS from command line

    Open a command prompt.

    You do not need Administrator user rights to run the commands in this walkthrough. However, you must have Administrator user rights if you want to run IIS Express on ports numbered 1024 or less. Run the following command to navigate to the IIS Express installation folder:

    cd \Program Files\IIS Express 
    

    or if you are using a 64-bit OS, run the following command: cd \Program Files (x86)\IIS Express Run the following command to view the IIS Express usage string:

    iisexpress /site:site-name
    

    and of course don't forget about port forwarding and firewall pass through.

    0 讨论(0)
提交回复
热议问题