简体   繁体   中英

IIS Signalr Hub Connection hang with more then one client on Windows 10 Home Edition

C# Web Signalr Hub hosted in IIS on windows 10 Home Edition, and have .Net C# client in Windows Universal App. if only one client connected to this Hub, then it works fine, but more then one connection got hang.

Tablet PC have below configuration: 4GB RAM, 32GM Memory, 1.44 GHz Atom processor. OS. Windows 10 Home Edition

It works fine with same configuration on Windows 10 Pro. But not on Windows 10 Home Edition

Move your Signalr Hub server to Windows Service from IIS hosted, this will have me to improve performance.

have look below code .

[assembly: OwinStartup(typeof(JOIN8POSShopService.Startup))]
namespace JOIN8POSShopService
{
  public partial class Service1 : ServiceBase
    {
        IDisposable SignalR;
        public Service1()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            try
            {
                ShopAPIAccess.WriteToFile("Join8 POS Service started.");
                try
                {
                    SignalR = WebApp.Start(ConfigurationManager.AppSettings["ShopHubURL"].ToString());
                    ShopAPIAccess.WriteToFile("Hub Server Stated");
                }
                catch (Exception ex)
                {
                    ShopAPIAccess.WriteToFile("Error OnStart Shop Signalr Hub " + ex.Message + " ST=" + ex.StackTrace);
                }

                //string reportTime = await DayEndAutomation();
                ScheduleService("23:00");
            }
            catch (Exception ex)
            {
                ShopAPIAccess.WriteToFile("Error OnStart " + ex.StackTrace);
            }

and Statup and hub class like this:

class Startup
{
    public void Configuration(IAppBuilder app)
    {
        app.UseCors(CorsOptions.AllowAll);
        app.MapSignalR();
        app.Map("/signalr", map =>
        {

            map.UseCors(CorsOptions.AllowAll);
            var hubConfiguration = new HubConfiguration
            {

            };


            map.RunSignalR(hubConfiguration);
        });
    }
}
[HubName("shopApiHub")]
public class ShopApiHub : Hub
{

    public override Task OnConnected()
    {
        ShopAPIAccess.WriteToFile("connection ID= " + Context.ConnectionId);
        return base.OnConnected();
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM