OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 TOOLS_ANDROID_COMMON_NET_H_ | 5 #ifndef TOOLS_ANDROID_COMMON_NET_H_ |
6 #define TOOLS_ANDROID_COMMON_NET_H_ | 6 #define TOOLS_ANDROID_COMMON_NET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 |
9 namespace tools { | 11 namespace tools { |
10 | 12 |
11 // DisableNagle can improve TCP transmission performance. Both Chrome net stack | 13 // DisableNagle can improve TCP transmission performance. Both Chrome net stack |
12 // and adb tool use it. | 14 // and adb tool use it. |
13 int DisableNagle(int socket); | 15 int DisableNagle(int socket); |
14 | 16 |
15 // Wake up listener only when data arrive. | 17 // Wake up listener only when data arrive. |
16 int DeferAccept(int socket); | 18 int DeferAccept(int socket); |
17 | 19 |
| 20 // Dumps a binary buffer into a string in a human-readable format. |
| 21 std::string DumpBinary(const char* buffer, size_t length); |
| 22 |
18 } // namespace tools | 23 } // namespace tools |
19 | 24 |
20 #endif // TOOLS_ANDROID_COMMON_NET_H_ | 25 #endif // TOOLS_ANDROID_COMMON_NET_H_ |
21 | 26 |
OLD | NEW |