Skip to content

Commit

Permalink
Merge pull request #74 from oraoto/master
Browse files Browse the repository at this point in the history
Fix TCP_NODELAY in Windows
  • Loading branch information
Enmk authored Jan 18, 2021
2 parents 3ea7e49 + 9179283 commit 33c58aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clickhouse/base/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ void SocketHolder::SetTcpKeepAlive(int idle, int intvl, int cnt) noexcept {

void SocketHolder::SetTcpNoDelay(bool nodelay) noexcept {
int val = nodelay;
#if defined(_unix_)
setsockopt(handle_, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
#else
setsockopt(handle_, IPPROTO_TCP, TCP_NODELAY, (const char*)&val, sizeof(val));
#endif
}

SocketHolder& SocketHolder::operator = (SocketHolder&& other) noexcept {
Expand Down

0 comments on commit 33c58aa

Please sign in to comment.