OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_P2P_BASE_UDPTRANSPORT_H_ | 11 #ifndef WEBRTC_P2P_BASE_UDPTRANSPORT_H_ |
12 #define WEBRTC_P2P_BASE_UDPTRANSPORT_H_ | 12 #define WEBRTC_P2P_BASE_UDPTRANSPORT_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "webrtc/api/udptransportinterface.h" | 17 #include "webrtc/api/ortc/udptransportinterface.h" |
18 #include "webrtc/base/asyncpacketsocket.h" // For PacketOptions. | 18 #include "webrtc/base/asyncpacketsocket.h" // For PacketOptions. |
19 #include "webrtc/base/optional.h" | 19 #include "webrtc/base/optional.h" |
20 #include "webrtc/base/thread_checker.h" | 20 #include "webrtc/base/thread_checker.h" |
21 #include "webrtc/p2p/base/packettransportinternal.h" | 21 #include "webrtc/p2p/base/packettransportinternal.h" |
22 | 22 |
23 namespace rtc { | 23 namespace rtc { |
24 class AsyncPacketSocket; | 24 class AsyncPacketSocket; |
25 struct PacketTime; | 25 struct PacketTime; |
26 struct SentPacket; | 26 struct SentPacket; |
27 class SocketAddress; | 27 class SocketAddress; |
28 } | 28 } |
29 | 29 |
30 namespace cricket { | 30 namespace cricket { |
31 | 31 |
32 // Implementation of UdpTransportInterface. | 32 // Implementation of UdpTransportInterface. |
33 // Used by OrtcFactory. | 33 // Used by OrtcFactory. |
34 class UdpTransport : public webrtc::UdpTransportInterface, | 34 class UdpTransport : public rtc::PacketTransportInternal, |
35 public rtc::PacketTransportInternal { | 35 virtual public webrtc::UdpTransportInterface { |
36 public: | 36 public: |
37 // |transport_name| is only used for identification/logging. | 37 // |transport_name| is only used for identification/logging. |
38 // |socket| must be non-null. | 38 // |socket| must be non-null. |
39 UdpTransport(const std::string& transport_name, | 39 UdpTransport(const std::string& transport_name, |
40 std::unique_ptr<rtc::AsyncPacketSocket> socket); | 40 std::unique_ptr<rtc::AsyncPacketSocket> socket); |
41 ~UdpTransport(); | 41 ~UdpTransport(); |
42 | 42 |
43 // Overrides of UdpTransportInterface, used by the API consumer. | 43 // Overrides of UdpTransportInterface, used by the API consumer. |
44 rtc::SocketAddress GetLocalAddress() const override; | 44 rtc::SocketAddress GetLocalAddress() const override; |
45 bool SetRemoteAddress(const rtc::SocketAddress& addr) override; | 45 bool SetRemoteAddress(const rtc::SocketAddress& addr) override; |
(...skipping 27 matching lines...) Expand all Loading... |
73 void OnSocketSentPacket(rtc::AsyncPacketSocket* socket, | 73 void OnSocketSentPacket(rtc::AsyncPacketSocket* socket, |
74 const rtc::SentPacket& packet); | 74 const rtc::SentPacket& packet); |
75 bool IsLocalConsistent(); | 75 bool IsLocalConsistent(); |
76 std::string transport_name_; | 76 std::string transport_name_; |
77 int send_error_ = 0; | 77 int send_error_ = 0; |
78 std::unique_ptr<rtc::AsyncPacketSocket> socket_; | 78 std::unique_ptr<rtc::AsyncPacketSocket> socket_; |
79 // If not set, will be an "nil" address ("IsNil" returns true). | 79 // If not set, will be an "nil" address ("IsNil" returns true). |
80 rtc::SocketAddress remote_address_; | 80 rtc::SocketAddress remote_address_; |
81 rtc::ThreadChecker network_thread_checker_; | 81 rtc::ThreadChecker network_thread_checker_; |
82 }; | 82 }; |
| 83 |
83 } // namespace cricket | 84 } // namespace cricket |
84 | 85 |
85 #endif // WEBRTC_P2P_BASE_UDPTRANSPORT_H_ | 86 #endif // WEBRTC_P2P_BASE_UDPTRANSPORT_H_ |
OLD | NEW |