c # SignalR a maximum amount of data sent

c # Signalr MessageSize default size is 64K, that is set to NULL to disable this limit, it can be changed according to the needs of the size of their own needs

. 1  public  class the Startup
 2      {
 . 3          public  void the Configuration (IAppBuilder App)
 . 4          {
 . 5              /// / details about how to configure the application, go to http://go.microsoft.com/fwlink/?LinkID=316888 
. 6              / // / domain access can be provided 
. 7              // app.UseCors (Microsoft.Owin.Cors.CorsOptions.AllowAll); 
. 8              /// / mapped to the default management
 . 9              /// / var hubConfiguration new new hubConfiguration = ();
 10              /// /hubConfiguration.EnableDetailedErrors = to true;
 . 11              /// /app.MapSignalR ( "/ SignalR", hubConfiguration); 
12 is             //app.MapSignalR();
13            
14             app.Map("/signalr", map =>
15             {
16                 // Setup the CORS middleware to run before SignalR.
17                 // By default this will allow all origins. You can 
18                 // configure the set of origins and/or http verbs by
19                 // providing a cors options with a different policy.
20                 map.UseCors(CorsOptions.AllowAll);
21         
22                 var hubConfiguration = new HubConfiguration
23                 {
24                     EnableJSONP = true,
25                     EnableJavaScriptProxies = true,
26                     EnableDetailedErrors = true,
27                   
28                     // You can enable JSONP by uncommenting line below.
29                     // JSONP requests are insecure but some older browsers (and some
30                     // versions of IE) require JSONP to work cross domain
31                     // EnableJSONP = true
32                 };
33                 // Run the SignalR pipeline. We're not using MapSignalR
34                 //the runs already an under the this Branch Operating since The "/ SignalR"
 35                  // . path
 36                  // maximum amount of data limits canceled 
37 [                  GlobalHost.Configuration.MaxIncomingWebSocketMessageSize = null ;
 38 is                  map.RunSignalR (hubConfiguration);
 39              });
 40          }
 41 is      }

The default buffer size data set GlobalHost.Configuration.DefaultMessageBufferSize = 1024

Guess you like

Origin www.cnblogs.com/weifeng123/p/12537476.html