如何提高java nio2的网络性能?

时间:2014-09-09 13:41:40

标签: java io nio nio2

我读了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, ...);

点对点还有其他方法吗?

0 个答案:

没有答案