Skip to content

Commit 33c58aa

Browse files
authored
Merge pull request #74 from oraoto/master
Fix TCP_NODELAY in Windows
2 parents 3ea7e49 + 9179283 commit 33c58aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clickhouse/base/socket.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ void SocketHolder::SetTcpKeepAlive(int idle, int intvl, int cnt) noexcept {
171171

172172
void SocketHolder::SetTcpNoDelay(bool nodelay) noexcept {
173173
int val = nodelay;
174+
#if defined(_unix_)
174175
setsockopt(handle_, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
176+
#else
177+
setsockopt(handle_, IPPROTO_TCP, TCP_NODELAY, (const char*)&val, sizeof(val));
178+
#endif
175179
}
176180

177181
SocketHolder& SocketHolder::operator = (SocketHolder&& other) noexcept {

0 commit comments

Comments
 (0)