You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Copyright 2016 The WebRTC Project Authors. All rights reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #include "rtc_base/null_socket_server.h"
  11. #include "rtc_base/checks.h"
  12. namespace rtc {
  13. NullSocketServer::NullSocketServer() = default;
  14. NullSocketServer::~NullSocketServer() {}
  15. bool NullSocketServer::Wait(int cms, bool process_io) {
  16. // Wait with the given timeout. Do not log a warning if we end up waiting for
  17. // a long time; that just means no one has any work for us, which is perfectly
  18. // legitimate.
  19. event_.Wait(/*give_up_after_ms=*/cms, /*warn_after_ms=*/Event::kForever);
  20. return true;
  21. }
  22. void NullSocketServer::WakeUp() {
  23. event_.Set();
  24. }
  25. rtc::Socket* NullSocketServer::CreateSocket(int /* family */, int /* type */) {
  26. RTC_NOTREACHED();
  27. return nullptr;
  28. }
  29. rtc::AsyncSocket* NullSocketServer::CreateAsyncSocket(int /* family */,
  30. int /* type */) {
  31. RTC_NOTREACHED();
  32. return nullptr;
  33. }
  34. } // namespace rtc