Ensure Nagle is always off.

This commit is contained in:
Peter Lawrey
2014-11-12 19:13:29 +00:00
parent 2169252dd1
commit 82b55fbd78
4 changed files with 91 additions and 1 deletions
@@ -88,6 +88,8 @@ abstract class AbstractChannelReplicator implements Closeable {
try {
result = SocketChannel.open();
result.socket().setTcpNoDelay(true);
} finally {
if (result != null)
try {
@@ -135,6 +135,8 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
try {
result = AbstractChannelReplicator.openSocketChannel(closeables);
result.connect(builder.remoteAddress());
result.socket().setTcpNoDelay(true);
doHandShaking(result);
break;
} catch (IOException e) {
@@ -754,7 +754,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
socketChannel.socket().setReuseAddress(true);
socketChannel.socket().setSoLinger(false, 0);
socketChannel.socket().setSoTimeout(0);
socketChannel.socket().setTcpNoDelay(true);
try {
socketChannel.connect(details.address());