Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: net/socket/tcp_socket.cc

Issue 1744153003: Revert of net: merge two versions of SetTCPNoDelay() function into one (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/socket/tcp_socket.h ('k') | net/socket/tcp_socket_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/socket/tcp_socket.h"
6
7 #include "build/build_config.h"
8
9 #if defined(OS_POSIX)
10 #include <sys/socket.h>
11 #include <netinet/in.h>
12 #include <netinet/tcp.h>
13 #elif defined(OS_WIN)
14 #include <winsock2.h>
15 #endif
16
17 namespace net {
18
19 bool SetTCPNoDelay(SocketDescriptor socket, bool no_delay) {
20 #if defined(OS_POSIX)
21 int on = no_delay ? 1 : 0;
22 #elif defined(OS_WIN)
23 BOOL on = no_delay ? TRUE : FALSE;
24 #endif
25 return setsockopt(socket, IPPROTO_TCP, TCP_NODELAY,
26 reinterpret_cast<const char*>(&on), sizeof(on)) == 0;
27 }
28
29 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/tcp_socket.h ('k') | net/socket/tcp_socket_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698