SignalR buffer size

ray6402
Posts: 5
Joined: Fri Aug 18, 2017 5:25 am

SignalR buffer size

Postby ray6402 » Mon May 07, 2018 7:21 am

Hi

How do I increase the buffer size for messages sent from the client using SignalR?

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: SignalR buffer size

Postby JS-Support @Userware » Mon May 07, 2018 7:57 am

Hi,

On the server-side, you need to set GlobalHost.Configuration.MaxIncomingWebSocketMessageSize to a greater value (the default is 65536 bytes). You can put it for example in the "Startup" method.

Regards,
JS-Support

ray6402
Posts: 5
Joined: Fri Aug 18, 2017 5:25 am

Re: SignalR buffer size

Postby ray6402 » Tue May 08, 2018 2:04 am

Tried that, doesn't work.

Using the SignalR example given in:
viewtopic.php?f=7&t=8121&p=9451&hilit=signalr#p9451
https://github.com/cshtml5/CSHTML5.Extensions.SignalR

Added to Startup.cs:

Code: Select all

// Made the buffer size five times larger
GlobalHost.Configuration.MaxIncomingWebSocketMessageSize = 327680;

Tried to send the Message using the demo messaging app.

Checked size of message using:
System.Text.ASCIIEncoding.Unicode(GetByteCount(string);

Maximum size is 2624

Anything above that and the Server will not receive any data.

How can I fix this?


Return to “General Discussion and Other”

Who is online

Users browsing this forum: No registered users and 23 guests

 

 

cron