tlsSocket.setMaxSendFragment(size)
tlsSocket.setMaxSendFragment()
方法设置最大 TLS 片段大小。
如果设置限制成功,则返回 true
;否则返回 false
。
较小的片段大小减少了客户端的缓冲延迟:较大的片段由 TLS 层缓冲,直到接收到整个片段并验证其完整性;大片段可以跨越多次往返,并且由于数据包丢失或重新排序,它们的处理可能会延迟。 但是,较小的片段会增加额外的 TLS 成帧字节和 CPU 开销,这可能会降低整体服务器吞吐量。
size
<number> The maximum TLS fragment size. The maximum value is16384
. Default:16384
.- Returns: <boolean>
The tlsSocket.setMaxSendFragment()
method sets the maximum TLS fragment size.
Returns true
if setting the limit succeeded; false
otherwise.
Smaller fragment sizes decrease the buffering latency on the client: larger fragments are buffered by the TLS layer until the entire fragment is received and its integrity is verified; large fragments can span multiple roundtrips and their processing can be delayed due to packet loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, which may decrease overall server throughput.