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

Side by Side Diff: net/tools/flip_server/tcp_socket_util.h

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/tools/flip_server/acceptor_thread.cc ('k') | net/tools/flip_server/tcp_socket_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_TOOLS_FLIP_SERVER_TCP_SOCKET_UTIL_H_ 5 #ifndef NET_TOOLS_FLIP_SERVER_TCP_SOCKET_UTIL_H_
6 #define NET_TOOLS_FLIP_SERVER_TCP_SOCKET_UTIL_H_ 6 #define NET_TOOLS_FLIP_SERVER_TCP_SOCKET_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 namespace net { 10 namespace net {
11 11
12 // This function disables buffering in the kernel. By default, TCP sockets
13 // will wait up to 200ms for more data to complete a packet before transmitting.
14 // After calling this function, the kernel will not wait. See TCP_NODELAY in
15 // `man 7 tcp`.
16 // This function returns true if it succeeds to set the TCP_NODELAY option,
17 // otherwise returns false.
18 bool SetTCPNoDelay(int fd);
19
12 // Summary: 20 // Summary:
13 // creates a socket for listening, and bind()s and listen()s it. 21 // creates a socket for listening, and bind()s and listen()s it.
14 // Args: 22 // Args:
15 // host - hostname or numeric address, or empty-string if you want 23 // host - hostname or numeric address, or empty-string if you want
16 // to bind to listen on all addresses 24 // to bind to listen on all addresses
17 // port - a port number or service name. By service name I mean a 25 // port - a port number or service name. By service name I mean a
18 // -real- service name, not a Google service name. I'd suggest 26 // -real- service name, not a Google service name. I'd suggest
19 // you just stick to a numeric representation like "80" 27 // you just stick to a numeric representation like "80"
20 // is_numeric_host_address - 28 // is_numeric_host_address -
21 // if you know that the host address has already been looked-up, 29 // if you know that the host address has already been looked-up,
(...skipping 23 matching lines...) Expand all
45 53
46 int CreateTCPClientSocket(const std::string& host, 54 int CreateTCPClientSocket(const std::string& host,
47 const std::string& port, 55 const std::string& port,
48 bool is_numeric_host_address, 56 bool is_numeric_host_address,
49 bool disable_nagle, 57 bool disable_nagle,
50 int* connect_fd); 58 int* connect_fd);
51 59
52 } // namespace net 60 } // namespace net
53 61
54 #endif // NET_TOOLS_FLIP_SERVER_TCP_SOCKET_UTIL_H_ 62 #endif // NET_TOOLS_FLIP_SERVER_TCP_SOCKET_UTIL_H_
OLDNEW
« no previous file with comments | « net/tools/flip_server/acceptor_thread.cc ('k') | net/tools/flip_server/tcp_socket_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698