net.h 700 B

123456789101112131415161718192021222324252627
  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
  3. // found in the LICENSE file.
  4. #ifndef TOOLS_ANDROID_COMMON_NET_H_
  5. #define TOOLS_ANDROID_COMMON_NET_H_
  6. #include <stddef.h>
  7. #include <string>
  8. namespace tools {
  9. // DisableNagle can improve TCP transmission performance. Both Chrome net stack
  10. // and adb tool use it.
  11. int DisableNagle(int socket);
  12. // Wake up listener only when data arrive.
  13. int DeferAccept(int socket);
  14. // Dumps a binary buffer into a string in a human-readable format.
  15. std::string DumpBinary(const char* buffer, size_t length);
  16. } // namespace tools
  17. #endif // TOOLS_ANDROID_COMMON_NET_H_