internals.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * Copyright (c) 2019-2021 Paul-Louis Ageneau
  3. *
  4. * This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  7. */
  8. #ifndef RTC_IMPL_INTERNALS_H
  9. #define RTC_IMPL_INTERNALS_H
  10. #include "common.hpp"
  11. // Disable warnings before including plog
  12. #if defined(__GNUC__) || defined(__clang__)
  13. #pragma GCC diagnostic push
  14. #pragma GCC diagnostic ignored "-Wall"
  15. #elif defined(_MSC_VER)
  16. #pragma warning(push, 0)
  17. #endif
  18. #include "plog/Log.h"
  19. #if defined(__GNUC__) || defined(__clang__)
  20. #pragma GCC diagnostic pop
  21. #elif defined(_MSC_VER)
  22. #pragma warning(pop)
  23. #endif
  24. namespace rtc {
  25. const size_t MAX_NUMERICNODE_LEN = 48; // Max IPv6 string representation length
  26. const size_t MAX_NUMERICSERV_LEN = 6; // Max port string representation length
  27. const uint16_t DEFAULT_SCTP_PORT = 5000; // SCTP port to use by default
  28. const uint16_t MAX_SCTP_STREAMS_COUNT = 1024; // Max number of negotiated SCTP streams
  29. // RFC 8831 recommends 65535 but usrsctp needs a lot
  30. // of memory, Chromium historically limits to 1024.
  31. const size_t DEFAULT_LOCAL_MAX_MESSAGE_SIZE = 256 * 1024; // Default local max message size
  32. const size_t DEFAULT_REMOTE_MAX_MESSAGE_SIZE = 65536; // Remote max message size if not in SDP
  33. const size_t DEFAULT_WS_MAX_MESSAGE_SIZE = 256 * 1024; // Default max message size for WebSockets
  34. const size_t RECV_QUEUE_LIMIT = 1024; // Max per-channel queue size (messages)
  35. const int MIN_THREADPOOL_SIZE = 4; // Minimum number of threads in the global thread pool (>= 2)
  36. const size_t DEFAULT_MTU = RTC_DEFAULT_MTU; // defined in rtc.h
  37. } // namespace rtc
  38. #endif