SignalR buffer size
Posted: Mon May 07, 2018 7:21 am
by ray6402
Hi
How do I increase the buffer size for messages sent from the client using SignalR?
Re: SignalR buffer size
Posted: Mon May 07, 2018 7:57 am
by JS-Support @Userware
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
Re: SignalR buffer size
Posted: Tue May 08, 2018 2:04 am
by ray6402
Tried that, doesn't work.
Using the SignalR example given in:
viewtopic.php?f=7&t=8121&p=9451&hilit=signalr#p9451https://github.com/cshtml5/CSHTML5.Extensions.SignalRAdded 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?