OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 channel_->SignalCandidateReady.connect(this, | 111 channel_->SignalCandidateReady.connect(this, |
112 &DtlsTransportChannelWrapper::OnCandidateReady); | 112 &DtlsTransportChannelWrapper::OnCandidateReady); |
113 channel_->SignalCandidatesAllocationDone.connect(this, | 113 channel_->SignalCandidatesAllocationDone.connect(this, |
114 &DtlsTransportChannelWrapper::OnCandidatesAllocationDone); | 114 &DtlsTransportChannelWrapper::OnCandidatesAllocationDone); |
115 channel_->SignalRoleConflict.connect(this, | 115 channel_->SignalRoleConflict.connect(this, |
116 &DtlsTransportChannelWrapper::OnRoleConflict); | 116 &DtlsTransportChannelWrapper::OnRoleConflict); |
117 channel_->SignalRouteChange.connect(this, | 117 channel_->SignalRouteChange.connect(this, |
118 &DtlsTransportChannelWrapper::OnRouteChange); | 118 &DtlsTransportChannelWrapper::OnRouteChange); |
119 channel_->SignalConnectionRemoved.connect(this, | 119 channel_->SignalConnectionRemoved.connect(this, |
120 &DtlsTransportChannelWrapper::OnConnectionRemoved); | 120 &DtlsTransportChannelWrapper::OnConnectionRemoved); |
121 channel_->SignalFlakyState.connect(this, | |
122 &DtlsTransportChannelWrapper::OnFlakyState); | |
121 } | 123 } |
122 | 124 |
123 DtlsTransportChannelWrapper::~DtlsTransportChannelWrapper() { | 125 DtlsTransportChannelWrapper::~DtlsTransportChannelWrapper() { |
124 } | 126 } |
125 | 127 |
126 void DtlsTransportChannelWrapper::Connect() { | 128 void DtlsTransportChannelWrapper::Connect() { |
127 // We should only get a single call to Connect. | 129 // We should only get a single call to Connect. |
128 ASSERT(dtls_state_ == STATE_NONE || | 130 ASSERT(dtls_state_ == STATE_NONE || |
129 dtls_state_ == STATE_OFFERED || | 131 dtls_state_ == STATE_OFFERED || |
130 dtls_state_ == STATE_ACCEPTED); | 132 dtls_state_ == STATE_ACCEPTED); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
449 case STATE_STARTED: | 451 case STATE_STARTED: |
450 // Do nothing | 452 // Do nothing |
451 break; | 453 break; |
452 | 454 |
453 case STATE_CLOSED: | 455 case STATE_CLOSED: |
454 // Should not happen. Do nothing | 456 // Should not happen. Do nothing |
455 break; | 457 break; |
456 } | 458 } |
457 } | 459 } |
458 | 460 |
461 void DtlsTransportChannelWrapper::OnFlakyState(TransportChannel* channel) { | |
462 ASSERT(rtc::Thread::Current() == worker_thread_); | |
463 ASSERT(channel == channel_); | |
464 LOG_J(LS_VERBOSE, this) | |
465 << "DTLSTransportChannelWrapper: channel flaky state changed to " | |
466 << channel_->flaky(); | |
467 if (dtls_state_ == STATE_NONE || dtls_state_ == STATE_OPEN) { | |
pthatcher1
2015/06/24 23:42:52
Why not just always set it, regardless of state?
honghaiz3
2015/08/05 23:56:56
For both set_readable and set_writable, they only
| |
468 // Note: SignalFlakyState fired by set_flaky. | |
469 set_flaky(channel_->flaky()); | |
470 } | |
471 } | |
472 | |
459 void DtlsTransportChannelWrapper::OnReadPacket( | 473 void DtlsTransportChannelWrapper::OnReadPacket( |
460 TransportChannel* channel, const char* data, size_t size, | 474 TransportChannel* channel, const char* data, size_t size, |
461 const rtc::PacketTime& packet_time, int flags) { | 475 const rtc::PacketTime& packet_time, int flags) { |
462 ASSERT(rtc::Thread::Current() == worker_thread_); | 476 ASSERT(rtc::Thread::Current() == worker_thread_); |
463 ASSERT(channel == channel_); | 477 ASSERT(channel == channel_); |
464 ASSERT(flags == 0); | 478 ASSERT(flags == 0); |
465 | 479 |
466 switch (dtls_state_) { | 480 switch (dtls_state_) { |
467 case STATE_NONE: | 481 case STATE_NONE: |
468 // We are not doing DTLS | 482 // We are not doing DTLS |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
631 SignalRouteChange(this, candidate); | 645 SignalRouteChange(this, candidate); |
632 } | 646 } |
633 | 647 |
634 void DtlsTransportChannelWrapper::OnConnectionRemoved( | 648 void DtlsTransportChannelWrapper::OnConnectionRemoved( |
635 TransportChannelImpl* channel) { | 649 TransportChannelImpl* channel) { |
636 ASSERT(channel == channel_); | 650 ASSERT(channel == channel_); |
637 SignalConnectionRemoved(this); | 651 SignalConnectionRemoved(this); |
638 } | 652 } |
639 | 653 |
640 } // namespace cricket | 654 } // namespace cricket |
OLD | NEW |