C # BS message push load Balancer-signalr&redis configuration (iii)

Source: Internet
Author: User

1. Preface

This article is based on the summary of the online predecessors.

Environment: SIGNALR2.X,VS2015,WIN10

2. Load Balancing Configuration

The configuration is simple, as long as you add Redis connections to the startup class.

1) First, introduce the SIGNALR package

Install-package Microsoft.AspNet.SignalR.Redis

2) in startup class

usingSystem;usingSystem.Threading.Tasks;usingMicrosoft.AspNet.SignalR;usingMicrosoft.owin;usingOwin; [Assembly:owinstartup (typeof(SignalRDemo.SignalR.StartupSignalR))]namespacesignalrdemo.signalr{ Public classSTARTUPSIGNALR { Public voidConfiguration (Iappbuilder app) {#regionRedis Configuration//Add RedisRedisscaleoutconfiguration redisscaleoutconfiguration =NewRedisscaleoutconfiguration ("ceswebnew.redis.cache.chinacloudapi.cn",6379,"xxxxxxxxxxxxxxxxxxxxxxxxxx/yko=","__REDIS_SIGNALR"); //Connect db, default is 0Redisscaleoutconfiguration.database =3; //Redis for SIGNALRGlobalHost.DependencyResolver.UseRedis (redisscaleoutconfiguration); #endregion            //For more information about how to configure an application, visithttp://go.microsoft.com/fwlink/?LinkID=316888App. MAPSIGNALR ();//Start Signalr        }    }}

C # BS message push load Balancer-signalr&redis configuration (iii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.