diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-11-28 00:20:43 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-11-28 00:20:43 +0900 |
| commit | 16e25ef4e1ca1fe1e3e8cdacd77de228f997ceaf (patch) | |
| tree | 5211dcdef9904b1a39f79c7b71b5ee6786b838a6 /src/SocketCore.cc | |
| parent | e781e6eac1e3f45c143d9db303bf394a17191ba2 (diff) | |
Enabled TCP_NODELAY in SocketCore::establishConnection and acceptConnection
Diffstat (limited to 'src/SocketCore.cc')
| -rw-r--r-- | src/SocketCore.cc | 2 |
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; |
