tlsSocket.setMaxSendFragment(size)
tlsSocket.setMaxSendFragment() 方法设置最大的 TLS 数据片段大小。如果设置限制成功,返回 true;否则返回 false。
【The tlsSocket.setMaxSendFragment() method sets the maximum TLS fragment size.
Returns true if setting the limit succeeded; false otherwise.】
较小的片段大小可以减少客户端的缓冲延迟:TLS 层会缓冲较大的片段,直到整个片段接收完成并且其完整性得到验证;较大的片段可能跨多个往返,并且由于数据包丢失或重排,其处理可能被延迟。然而,较小的片段会增加额外的 TLS 帧字节和 CPU 开销,这可能会降低服务器的整体吞吐量。
【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.】