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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 // Returns the readable and states of this channel. Each time one of these | 65 // Returns the readable and states of this channel. Each time one of these |
66 // states changes, a signal is raised. These states are aggregated by the | 66 // states changes, a signal is raised. These states are aggregated by the |
67 // TransportManager. | 67 // TransportManager. |
68 bool readable() const { return readable_; } | 68 bool readable() const { return readable_; } |
69 bool writable() const { return writable_; } | 69 bool writable() const { return writable_; } |
70 sigslot::signal1<TransportChannel*> SignalReadableState; | 70 sigslot::signal1<TransportChannel*> SignalReadableState; |
71 sigslot::signal1<TransportChannel*> SignalWritableState; | 71 sigslot::signal1<TransportChannel*> SignalWritableState; |
72 // Emitted when the TransportChannel's ability to send has changed. | 72 // Emitted when the TransportChannel's ability to send has changed. |
73 sigslot::signal1<TransportChannel*> SignalReadyToSend; | 73 sigslot::signal1<TransportChannel*> SignalReadyToSend; |
74 | 74 |
75 bool flaky() const { return flaky_; } | |
76 sigslot::signal1<TransportChannel*> SignalFlakyState; | |
77 | |
75 // Attempts to send the given packet. The return value is < 0 on failure. | 78 // Attempts to send the given packet. The return value is < 0 on failure. |
76 // TODO: Remove the default argument once channel code is updated. | 79 // TODO: Remove the default argument once channel code is updated. |
77 virtual int SendPacket(const char* data, size_t len, | 80 virtual int SendPacket(const char* data, size_t len, |
78 const rtc::PacketOptions& options, | 81 const rtc::PacketOptions& options, |
79 int flags = 0) = 0; | 82 int flags = 0) = 0; |
80 | 83 |
81 // Sets a socket option on this channel. Note that not all options are | 84 // Sets a socket option on this channel. Note that not all options are |
82 // supported by all transport types. | 85 // supported by all transport types. |
83 virtual int SetOption(rtc::Socket::Option opt, int value) = 0; | 86 virtual int SetOption(rtc::Socket::Option opt, int value) = 0; |
84 // TODO(pthatcher): Once Chrome's MockTransportChannel implments | 87 // TODO(pthatcher): Once Chrome's MockTransportChannel implments |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 // Debugging description of this transport channel. | 138 // Debugging description of this transport channel. |
136 std::string ToString() const; | 139 std::string ToString() const; |
137 | 140 |
138 protected: | 141 protected: |
139 // Sets the readable state, signaling if necessary. | 142 // Sets the readable state, signaling if necessary. |
140 void set_readable(bool readable); | 143 void set_readable(bool readable); |
141 | 144 |
142 // Sets the writable state, signaling if necessary. | 145 // Sets the writable state, signaling if necessary. |
143 void set_writable(bool writable); | 146 void set_writable(bool writable); |
144 | 147 |
148 // Sets the flaky state, signaling if necessary. | |
149 void set_flaky(bool flaky); | |
150 | |
145 | 151 |
146 private: | 152 private: |
147 // Used mostly for debugging. | 153 // Used mostly for debugging. |
148 std::string content_name_; | 154 std::string content_name_; |
149 int component_; | 155 int component_; |
150 bool readable_; | 156 bool readable_; |
151 bool writable_; | 157 bool writable_; |
158 bool flaky_; | |
pthatcher1
2015/06/24 23:42:52
I'm not completely sure we want to have flaky_ be
| |
152 | 159 |
153 DISALLOW_COPY_AND_ASSIGN(TransportChannel); | 160 DISALLOW_COPY_AND_ASSIGN(TransportChannel); |
154 }; | 161 }; |
155 | 162 |
156 } // namespace cricket | 163 } // namespace cricket |
157 | 164 |
158 #endif // WEBRTC_P2P_BASE_TRANSPORTCHANNEL_H_ | 165 #endif // WEBRTC_P2P_BASE_TRANSPORTCHANNEL_H_ |
OLD | NEW |