OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 |
(...skipping 30 matching lines...) Expand all Loading... |
41 STATE_INIT, | 41 STATE_INIT, |
42 STATE_CONNECTING, // Will enter this state once a connection is created | 42 STATE_CONNECTING, // Will enter this state once a connection is created |
43 STATE_COMPLETED, | 43 STATE_COMPLETED, |
44 STATE_FAILED | 44 STATE_FAILED |
45 }; | 45 }; |
46 | 46 |
47 // A TransportChannel represents one logical stream of packets that are sent | 47 // A TransportChannel represents one logical stream of packets that are sent |
48 // between the two sides of a session. | 48 // between the two sides of a session. |
49 class TransportChannel : public sigslot::has_slots<> { | 49 class TransportChannel : public sigslot::has_slots<> { |
50 public: | 50 public: |
51 explicit TransportChannel(const std::string& transport_name, int component) | 51 TransportChannel(const std::string& transport_name, int component) |
52 : transport_name_(transport_name), | 52 : transport_name_(transport_name), |
53 component_(component), | 53 component_(component), |
54 writable_(false), | 54 writable_(false), |
55 receiving_(false) {} | 55 receiving_(false) {} |
56 virtual ~TransportChannel() {} | 56 virtual ~TransportChannel() {} |
57 | 57 |
58 // TODO(guoweis) - Make this pure virtual once all subclasses of | 58 // TODO(guoweis) - Make this pure virtual once all subclasses of |
59 // TransportChannel have this defined. | 59 // TransportChannel have this defined. |
60 virtual TransportChannelState GetState() const { | 60 virtual TransportChannelState GetState() const { |
61 return TransportChannelState::STATE_CONNECTING; | 61 return TransportChannelState::STATE_CONNECTING; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 const uint8* context, | 129 const uint8* context, |
130 size_t context_len, | 130 size_t context_len, |
131 bool use_context, | 131 bool use_context, |
132 uint8* result, | 132 uint8* result, |
133 size_t result_len) = 0; | 133 size_t result_len) = 0; |
134 | 134 |
135 // Signalled each time a packet is received on this channel. | 135 // Signalled each time a packet is received on this channel. |
136 sigslot::signal5<TransportChannel*, const char*, | 136 sigslot::signal5<TransportChannel*, const char*, |
137 size_t, const rtc::PacketTime&, int> SignalReadPacket; | 137 size_t, const rtc::PacketTime&, int> SignalReadPacket; |
138 | 138 |
| 139 // Signalled each time a packet is sent on this channel. |
| 140 sigslot::signal2<TransportChannel*, const rtc::SentPacket&> SignalSentPacket; |
| 141 |
139 // This signal occurs when there is a change in the way that packets are | 142 // This signal occurs when there is a change in the way that packets are |
140 // being routed, i.e. to a different remote location. The candidate | 143 // being routed, i.e. to a different remote location. The candidate |
141 // indicates where and how we are currently sending media. | 144 // indicates where and how we are currently sending media. |
142 sigslot::signal2<TransportChannel*, const Candidate&> SignalRouteChange; | 145 sigslot::signal2<TransportChannel*, const Candidate&> SignalRouteChange; |
143 | 146 |
144 // Invoked when the channel is being destroyed. | 147 // Invoked when the channel is being destroyed. |
145 sigslot::signal1<TransportChannel*> SignalDestroyed; | 148 sigslot::signal1<TransportChannel*> SignalDestroyed; |
146 | 149 |
147 // Debugging description of this transport channel. | 150 // Debugging description of this transport channel. |
148 std::string ToString() const; | 151 std::string ToString() const; |
(...skipping 14 matching lines...) Expand all Loading... |
163 int component_; | 166 int component_; |
164 bool writable_; | 167 bool writable_; |
165 bool receiving_; | 168 bool receiving_; |
166 | 169 |
167 RTC_DISALLOW_COPY_AND_ASSIGN(TransportChannel); | 170 RTC_DISALLOW_COPY_AND_ASSIGN(TransportChannel); |
168 }; | 171 }; |
169 | 172 |
170 } // namespace cricket | 173 } // namespace cricket |
171 | 174 |
172 #endif // WEBRTC_P2P_BASE_TRANSPORTCHANNEL_H_ | 175 #endif // WEBRTC_P2P_BASE_TRANSPORTCHANNEL_H_ |
OLD | NEW |