summaryrefslogtreecommitdiff
path: root/src/SocketCore.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/SocketCore.cc')
-rw-r--r--src/SocketCore.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/SocketCore.cc b/src/SocketCore.cc
index 55c97d08..619002be 100644
--- a/src/SocketCore.cc
+++ b/src/SocketCore.cc
@@ -409,7 +409,8 @@ int SocketCore::getPeerInfo(std::pair<std::string, uint16_t>& peerinfo) const
return sockaddr.storage.ss_family;
}
-void SocketCore::establishConnection(const std::string& host, uint16_t port)
+void SocketCore::establishConnection(const std::string& host, uint16_t port,
+ bool tcpNodelay)
{
closeConnection();
std::string error;
@@ -461,6 +462,9 @@ void SocketCore::establishConnection(const std::string& host, uint16_t port)
sockfd_ = fd;
// make socket non-blocking mode
setNonBlockingMode();
+ if(tcpNodelay) {
+ setTcpNodelay(true);
+ }
if(connect(fd, rp->ai_addr, rp->ai_addrlen) == -1 &&
SOCKET_ERRNO != A2_EINPROGRESS) {
errNum = SOCKET_ERRNO;