summaryrefslogtreecommitdiff
path: root/src/SocketCore.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-11-28 00:20:43 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-11-28 00:20:43 +0900
commit16e25ef4e1ca1fe1e3e8cdacd77de228f997ceaf (patch)
tree5211dcdef9904b1a39f79c7b71b5ee6786b838a6 /src/SocketCore.cc
parente781e6eac1e3f45c143d9db303bf394a17191ba2 (diff)
Enabled TCP_NODELAY in SocketCore::establishConnection and acceptConnection
Diffstat (limited to 'src/SocketCore.cc')
-rw-r--r--src/SocketCore.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/SocketCore.cc b/src/SocketCore.cc
index 9edd2c41..9bac58d4 100644
--- a/src/SocketCore.cc
+++ b/src/SocketCore.cc
@@ -369,6 +369,7 @@ SharedHandle<SocketCore> SocketCore::acceptConnection() const
}
SharedHandle<SocketCore> sock(new SocketCore(fd, sockType_));
sock->setNonBlockingMode();
+ sock->setTcpNodelay(true);
return sock;
}
@@ -461,6 +462,7 @@ void SocketCore::establishConnection(const std::string& host, uint16_t port)
sockfd_ = fd;
// make socket non-blocking mode
setNonBlockingMode();
+ setTcpNodelay(true);
if(connect(fd, rp->ai_addr, rp->ai_addrlen) == -1 &&
SOCKET_ERRNO != A2_EINPROGRESS) {
errNum = SOCKET_ERRNO;