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 19 matching lines...) Expand all Loading... |
30 class Candidate; | 30 class Candidate; |
31 | 31 |
32 // Flags for SendPacket/SignalReadPacket. | 32 // Flags for SendPacket/SignalReadPacket. |
33 enum PacketFlags { | 33 enum PacketFlags { |
34 PF_NORMAL = 0x00, // A normal packet. | 34 PF_NORMAL = 0x00, // A normal packet. |
35 PF_SRTP_BYPASS = 0x01, // An encrypted SRTP packet; bypass any additional | 35 PF_SRTP_BYPASS = 0x01, // An encrypted SRTP packet; bypass any additional |
36 // crypto provided by the transport (e.g. DTLS) | 36 // crypto provided by the transport (e.g. DTLS) |
37 }; | 37 }; |
38 | 38 |
39 // Used to indicate channel's connection state. | 39 // Used to indicate channel's connection state. |
40 enum TransportChannelState { STATE_CONNECTING, STATE_COMPLETED, STATE_FAILED }; | 40 enum TransportChannelState { |
| 41 STATE_INIT, |
| 42 STATE_CONNECTING, // Will enter this state once a connection is created |
| 43 STATE_COMPLETED, |
| 44 STATE_FAILED |
| 45 }; |
41 | 46 |
42 // A TransportChannel represents one logical stream of packets that are sent | 47 // A TransportChannel represents one logical stream of packets that are sent |
43 // between the two sides of a session. | 48 // between the two sides of a session. |
44 class TransportChannel : public sigslot::has_slots<> { | 49 class TransportChannel : public sigslot::has_slots<> { |
45 public: | 50 public: |
46 explicit TransportChannel(const std::string& content_name, int component) | 51 explicit TransportChannel(const std::string& content_name, int component) |
47 : content_name_(content_name), | 52 : content_name_(content_name), |
48 component_(component), | 53 component_(component), |
49 readable_(false), writable_(false), receiving_(false) {} | 54 readable_(false), writable_(false), receiving_(false) {} |
50 virtual ~TransportChannel() {} | 55 virtual ~TransportChannel() {} |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 protected: | 145 protected: |
141 // Sets the readable state, signaling if necessary. | 146 // Sets the readable state, signaling if necessary. |
142 void set_readable(bool readable); | 147 void set_readable(bool readable); |
143 | 148 |
144 // Sets the writable state, signaling if necessary. | 149 // Sets the writable state, signaling if necessary. |
145 void set_writable(bool writable); | 150 void set_writable(bool writable); |
146 | 151 |
147 // Sets the receiving state, signaling if necessary. | 152 // Sets the receiving state, signaling if necessary. |
148 void set_receiving(bool receiving); | 153 void set_receiving(bool receiving); |
149 | 154 |
150 | |
151 private: | 155 private: |
152 // Used mostly for debugging. | 156 // Used mostly for debugging. |
153 std::string content_name_; | 157 std::string content_name_; |
154 int component_; | 158 int component_; |
155 bool readable_; | 159 bool readable_; |
156 bool writable_; | 160 bool writable_; |
157 bool receiving_; | 161 bool receiving_; |
158 | 162 |
159 DISALLOW_COPY_AND_ASSIGN(TransportChannel); | 163 DISALLOW_COPY_AND_ASSIGN(TransportChannel); |
160 }; | 164 }; |
161 | 165 |
162 } // namespace cricket | 166 } // namespace cricket |
163 | 167 |
164 #endif // WEBRTC_P2P_BASE_TRANSPORTCHANNEL_H_ | 168 #endif // WEBRTC_P2P_BASE_TRANSPORTCHANNEL_H_ |
OLD | NEW |