1、为什么我采用两种发送方式会有不同的效果呢?
2、下面是一段关于TCP_NODELAY的解释,我现在不知道它的出处。
The TCP_NODELAY option disables the Nagle algorithm. The Nagle algorithm is used to reduce the number of small packets sent by a host by buffering unacknowledged send data until a full-size packet can be sent. However, for some applications this algorithm can impede performance, and TCP_NODELAY can be used to turn it off. Application writers should not set TCP_NODELAY unless the impact of doing so is well-understood and desired, since setting TCP_NODELAY can have a significant negative impact on network performance. TCP_NODELAY is the only supported socket option which uses level IPPROTO_TCP; all other options use level SOL_SOCKET.
我对它的理解就是打开这个选项能够阻止累积包的产生,从而增加通信的实时性。同时再QNX的HELP里也有类似的说明。
3、我希望能通过这样探讨得到一些启发,从而解决我的问题。