您所描述的听起来像是在发送请求之前HTTPService
没有在其套接字上设置TCP_NODELAY
套接字选项( )。setsockopt(3)
从我的 Linux tcp(7)
:
TCP_NODELAY
If set, disable the Nagle algorithm. This means that
segments are always sent as soon as possible, even if
there is only a small amount of data. When not set,
data is buffered until there is a sufficient amount to
send out, thereby avoiding the frequent sending of
small packets, which results in poor utilization of
the network. This option is overridden by TCP_CORK;
however, setting this option forces an explicit flush
of pending output, even if TCP_CORK is currently set.
也许您的平台有另一种方法,您可以要求为特定连接禁用Nagle 算法。