|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 |
|
6 #ifndef NULL_TRANSPORT_H_ |
|
7 #define NULL_TRANSPORT_H_ |
|
8 |
|
9 #include "mozilla/Attributes.h" |
|
10 |
|
11 #include "webrtc/common_types.h" |
|
12 |
|
13 namespace mozilla { |
|
14 |
|
15 /** |
|
16 * NullTransport is registered as ExternalTransport to throw away data |
|
17 */ |
|
18 class NullTransport : public webrtc::Transport |
|
19 { |
|
20 public: |
|
21 virtual int SendPacket(int channel, const void *data, int len) |
|
22 { |
|
23 (void) channel; (void) data; |
|
24 return len; |
|
25 } |
|
26 |
|
27 virtual int SendRTCPPacket(int channel, const void *data, int len) |
|
28 { |
|
29 (void) channel; (void) data; |
|
30 return len; |
|
31 } |
|
32 |
|
33 NullTransport() {} |
|
34 |
|
35 virtual ~NullTransport() {} |
|
36 |
|
37 private: |
|
38 NullTransport(const NullTransport& other) MOZ_DELETE; |
|
39 void operator=(const NullTransport& other) MOZ_DELETE; |
|
40 }; |
|
41 |
|
42 } // end namespace |
|
43 |
|
44 #endif |