0

我阅读了nio2的api,并找到了这些改进方法:

AsynchronousSocketChannel.setOption(StandardSocketOptions.SO_RCVBUF, [size]);
AsynchronousSocketChannel.setOption(StandardSocketOptions.SO_SNDBUF, [size]);
[size] = RTT (from ping) * bandwidth (from net-card)

这些取决于给定的情况:

AsynchronousSocketChannel.setOption(StandardSocketOptions.TCP_NODELAY, ...); 
AsynchronousSocketChannel.setOption(StandardSocketOptions.SO_REUSEADDR, ...);
AsynchronousSocketChannel.setOption(StandardSocketOptions.SO_KEEPALIVE, ...);

点对点还有其他方法吗?

4

0 回答 0