aboutsummaryrefslogtreecommitdiff
path: root/webrtc/p2p/base/dtlstransportchannel.cc
diff options
context:
space:
mode:
authorGuo-wei Shieh <guoweis@chromium.org>2015-04-06 12:48:47 -0700
committerGuo-wei Shieh <guoweis@chromium.org>2015-04-06 19:48:53 +0000
commitbe508a1d3634ce63b64cd740c44600453e3c3a6b (patch)
tree7c337b664e56676bbb604884ea80c76553b307c2 /webrtc/p2p/base/dtlstransportchannel.cc
parentef88309a6e2b3193cf1658bf245de295900ba4fe (diff)
downloadwebrtc-be508a1d3634ce63b64cd740c44600453e3c3a6b.tar.gz
Implement Tcp Reconnect for TCPPort.
UDP case should not be changed. Active TCPConnection will initiate Reconnect after OnClose and when Send or Ping fails. Passive TCPConnection will prune itself as usual as the active side will create a new connection. The Reconnect could make P2PCT choose a different best_connection in the case where connectivities exist b/w more than 1 Network. Also, to avoid upper layer triggers ice restart, the WRITE_TIMEOUT caused by the socket disconnection is delayed to give the reconnect mechanism chance to kick in. The timeout event is only fired if the reconnect can't work in 5 sec. If the reconnect, there should be no ICE disconnected state trigger either in active or passive side. BUG=1926 R=pthatcher@webrtc.org Review URL: https://webrtc-codereview.appspot.com/31359004 Cr-Commit-Position: refs/heads/master@{#8929}
Diffstat (limited to 'webrtc/p2p/base/dtlstransportchannel.cc')
-rw-r--r--webrtc/p2p/base/dtlstransportchannel.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc
index ca561a0898..3344bffe27 100644
--- a/webrtc/p2p/base/dtlstransportchannel.cc
+++ b/webrtc/p2p/base/dtlstransportchannel.cc
@@ -398,7 +398,8 @@ void DtlsTransportChannelWrapper::OnReadableState(TransportChannel* channel) {
ASSERT(rtc::Thread::Current() == worker_thread_);
ASSERT(channel == channel_);
LOG_J(LS_VERBOSE, this)
- << "DTLSTransportChannelWrapper: channel readable state changed.";
+ << "DTLSTransportChannelWrapper: channel readable state changed to "
+ << channel_->readable();
if (dtls_state_ == STATE_NONE || dtls_state_ == STATE_OPEN) {
set_readable(channel_->readable());
@@ -410,7 +411,8 @@ void DtlsTransportChannelWrapper::OnWritableState(TransportChannel* channel) {
ASSERT(rtc::Thread::Current() == worker_thread_);
ASSERT(channel == channel_);
LOG_J(LS_VERBOSE, this)
- << "DTLSTransportChannelWrapper: channel writable state changed.";
+ << "DTLSTransportChannelWrapper: channel writable state changed to "
+ << channel_->writable();
switch (dtls_state_) {
case STATE_NONE: