You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 1, 2023. It is now read-only.
I have created a websocket using Owin.Websocket.WebSocketConnection to receive messages from my Frontend.
public class MyWebScoket : WebSocketConnection
{
protected MyWebScoket(int maxMessageSize = 65536) : base(maxMessageSize)
{
//logic
}
public override void OnClose(WebSocketCloseStatus? closeStatus, string closeStatusDescription)
{
//logic
}
public override Task OnMessageReceived(ArraySegment<byte> message, WebSocketMessageType type)
{
//logic
}
public override void OnOpen()
{
//logic
}
public override void OnReceiveError(Exception error)
{
//logic
}
}
When the message size is below the set message size, CPU usage of API is normal and everything is functioning as it should, however when the message size exceeds the limit, CPU usage of API increases dramatically, causing my machine to stop responding even to mouse clicks.
This seems strange, as the message sending rate is always the same.
What is the reason of such behavior?
I added breakpoints inside all overridden methods, but none of them is reached, I thought if the message limit size is exceeded the execution should go to OnReceiveError.