WebSocketSharp 的最大文本消息大小是多少?

时间:2021-06-15 07:46:51

标签: c# .net websocket size message

我想知道:WebSocketSharp 的最大文本消息大小是多少? 如果消息字符串超过最大大小,是否会被拆分成小块数据,并通过 websocket 发送到服务器端?

3 个答案:

答案 0 :(得分:0)

我认为合适的方式是直接在github上问这个问题https://github.com/sta/websocket-sharp

答案 1 :(得分:0)

查看 source code 似乎没有最大尺寸。有一个带有以下注释的内部字段 FragmentLength

/// <summary>
/// Represents the length used to determine whether the data should be fragmented in sending.
/// </summary>
/// <remarks>
///   <para>
///   The data will be fragmented if that length is greater than the value of this field.
///   </para>
///   <para>
///   If you would like to change the value, you must set it to a value between <c>125</c> and
///   <c>Int32.MaxValue - 14</c> inclusive.
///   </para>
/// </remarks>

答案 2 :(得分:0)

我认为说 WebSocket 有一些最大消息长度是错误的。有一些buffer,如果您的信息多于它,您将分部分获取您的信息。但只有最后一部分会有 EndOfMessage=true。

相关问题