Open Elliot9 opened 7 years ago
i got the same problem yet, have you resolve it ?
Would love to get more information on this as well
I remember that I have solved the problem. But it’s been too long. So I forgot the detail, maybe u have send the long string with length
send it with length? somehow include the length/bit size in the request?
like Me("content-length") = Content.Length.ToString()
excuse me for my ignorance, not following how that would be added to my code.
In their example, where would you add it:
using WebSocketSharp;
namespace Example
{
public class Program
{
public static void Main (string[] args)
{
using (var ws = new WebSocket ("ws://dragonsnest.far/Laputa")) {
ws.OnMessage += (sender, e) =>
Console.WriteLine ("Laputa says: " + e.Data);
ws.Connect ();
ws.Send ("BALUS");
Console.ReadKey (true);
}
}
}
}
In the project I'm working on, a botclient will make and maintain a huge amount of WS connection to our server.
We use binary message only, and use 2 bytes in the message data as header. And there's a custom heartbeat message which is only 2 bytes per message, sent by the server every 10 seconds per clients.
It seems that if a process concurrently keeps too many connection, this error happens. (ex: 5000 is fine. Connections drops randomly when we tested with 10000)
p.s. Both server and the client process The CPU usage is not full.
hi , my problem is when i sent a long String , the error happened like :
|Fatal|<>c__DisplayClass17.<startReceiving>b__16|WebSocketSharp.WebSocketException: The header of a frame cannot be read from the stream. 於 WebSocketSharp.WebSocketFrame.processHeader(Byte[] header) 於 WebSocketSharp.WebSocketFrame.<>c__DisplayClassa.<readHeaderAsync>b__9(Byte[] bytes) 於 WebSocketSharp.Ext.<>c__DisplayClass9.<ReadBytesAsync>b__8(IAsyncResult ar) WebSocketSharp.CloseEventArgs
And i found someone had the problem too like this so i wonder know ,how can i solve this problem and i try to set FragmentLength ,but i don't know how to do that my Application is a Winsform client include websocketsharp.dll(on Nuget version 1.0.3-rc11) and i try to sent long String to Stomp&SockJs Websocket Server BTW,Sending short String is work , and i found the max length i can sent (Encoding.GetEncoding("utf-8").GetBytes ) it's 16546 , Any ideas?