blob: b2071e3baa27c9328d7d2ff8974f996cbba66cce [file] [log] [blame]
danilchapbebf54c2016-04-28 01:32:48 -07001/*
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
Steve Anton10542f22019-01-11 09:11:00 -080011#include "rtc_base/null_socket_server.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020012#include "rtc_base/checks.h"
danilchapbebf54c2016-04-28 01:32:48 -070013
14namespace rtc {
15
Niels Möllerc572ff32018-11-07 08:43:50 +010016NullSocketServer::NullSocketServer() = default;
danilchapbebf54c2016-04-28 01:32:48 -070017NullSocketServer::~NullSocketServer() {}
18
19bool NullSocketServer::Wait(int cms, bool process_io) {
Karl Wibergfc47c862019-04-11 10:31:24 +020020 // Wait with the given timeout. Do not log a warning if we end up waiting for
21 // a long time; that just means no one has any work for us, which is perfectly
22 // legitimate.
23 event_.Wait(/*give_up_after_ms=*/cms, /*warn_after_ms=*/Event::kForever);
danilchapbebf54c2016-04-28 01:32:48 -070024 return true;
25}
26
27void NullSocketServer::WakeUp() {
28 event_.Set();
29}
30
danilchapbebf54c2016-04-28 01:32:48 -070031rtc::Socket* NullSocketServer::CreateSocket(int /* family */, int /* type */) {
32 RTC_NOTREACHED();
33 return nullptr;
34}
35
danilchapbebf54c2016-04-28 01:32:48 -070036rtc::AsyncSocket* NullSocketServer::CreateAsyncSocket(int /* family */,
37 int /* type */) {
38 RTC_NOTREACHED();
39 return nullptr;
40}
41
42} // namespace rtc