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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 TCPPort::~TCPPort() { | 118 TCPPort::~TCPPort() { |
119 delete socket_; | 119 delete socket_; |
120 std::list<Incoming>::iterator it; | 120 std::list<Incoming>::iterator it; |
121 for (it = incoming_.begin(); it != incoming_.end(); ++it) | 121 for (it = incoming_.begin(); it != incoming_.end(); ++it) |
122 delete it->socket; | 122 delete it->socket; |
123 incoming_.clear(); | 123 incoming_.clear(); |
124 } | 124 } |
125 | 125 |
126 Connection* TCPPort::CreateConnection(const Candidate& address, | 126 Connection* TCPPort::CreateConnection(const Candidate& address, |
127 CandidateOrigin origin) { | 127 CandidateOrigin origin) { |
128 // We only support TCP protocols | 128 if (!SupportsProtocol(address.protocol())) { |
129 if ((address.protocol() != TCP_PROTOCOL_NAME) && | |
130 (address.protocol() != SSLTCP_PROTOCOL_NAME)) { | |
131 return NULL; | 129 return NULL; |
132 } | 130 } |
133 | 131 |
134 if (address.tcptype() == TCPTYPE_ACTIVE_STR || | 132 if (address.tcptype() == TCPTYPE_ACTIVE_STR || |
135 (address.tcptype().empty() && address.address().port() == 0)) { | 133 (address.tcptype().empty() && address.address().port() == 0)) { |
136 // It's active only candidate, we should not try to create connections | 134 // It's active only candidate, we should not try to create connections |
137 // for these candidates. | 135 // for these candidates. |
138 return NULL; | 136 return NULL; |
139 } | 137 } |
140 | 138 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 void TCPConnection::ConnectSocketSignals(rtc::AsyncPacketSocket* socket) { | 499 void TCPConnection::ConnectSocketSignals(rtc::AsyncPacketSocket* socket) { |
502 if (outgoing_) { | 500 if (outgoing_) { |
503 socket->SignalConnect.connect(this, &TCPConnection::OnConnect); | 501 socket->SignalConnect.connect(this, &TCPConnection::OnConnect); |
504 } | 502 } |
505 socket->SignalReadPacket.connect(this, &TCPConnection::OnReadPacket); | 503 socket->SignalReadPacket.connect(this, &TCPConnection::OnReadPacket); |
506 socket->SignalReadyToSend.connect(this, &TCPConnection::OnReadyToSend); | 504 socket->SignalReadyToSend.connect(this, &TCPConnection::OnReadyToSend); |
507 socket->SignalClose.connect(this, &TCPConnection::OnClose); | 505 socket->SignalClose.connect(this, &TCPConnection::OnClose); |
508 } | 506 } |
509 | 507 |
510 } // namespace cricket | 508 } // namespace cricket |
OLD | NEW |