Fix clang style warnings in p2p/base/port.h and its subclasses

Bug: webrtc:163
Change-Id: I8308bf1f1b4cf57edd2eb8fda010cb8b667771a2
Reviewed-on: https://webrtc-review.googlesource.com/16361
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20483}
This commit is contained in:
Steve Anton 2017-10-30 10:00:15 -07:00 committed by Commit Bot
parent 36b29d1df3
commit 1cf1b7d66f
13 changed files with 264 additions and 154 deletions

View File

@ -48,6 +48,7 @@ rtc_static_library("rtc_p2p") {
"base/port.h",
"base/portallocator.cc",
"base/portallocator.h",
"base/portinterface.cc",
"base/portinterface.h",
"base/pseudotcp.cc",
"base/pseudotcp.h",

View File

@ -229,6 +229,32 @@ Port::~Port() {
delete list[i];
}
const std::string& Port::Type() const {
return type_;
}
rtc::Network* Port::Network() const {
return network_;
}
IceRole Port::GetIceRole() const {
return ice_role_;
}
void Port::SetIceRole(IceRole role) {
ice_role_ = role;
}
void Port::SetIceTiebreaker(uint64_t tiebreaker) {
tiebreaker_ = tiebreaker;
}
uint64_t Port::IceTiebreaker() const {
return tiebreaker_;
}
bool Port::SharedSocket() const {
return shared_socket_;
}
void Port::SetIceParameters(int component,
const std::string& username_fragment,
const std::string& password) {
@ -242,6 +268,10 @@ void Port::SetIceParameters(int component,
}
}
const std::vector<Candidate>& Port::Candidates() const {
return candidates_;
}
Connection* Port::GetConnection(const rtc::SocketAddress& remote_addr) {
AddressMap::const_iterator iter = connections_.find(remote_addr);
if (iter != connections_.end())
@ -577,6 +607,15 @@ void Port::CreateStunUsername(const std::string& remote_username,
stun_username_attr_str->append(username_fragment());
}
bool Port::HandleIncomingPacket(rtc::AsyncPacketSocket* socket,
const char* data,
size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time) {
RTC_NOTREACHED();
return false;
}
void Port::SendBindingResponse(StunMessage* request,
const rtc::SocketAddress& addr) {
RTC_DCHECK(request->type() == STUN_BINDING_REQUEST);
@ -775,9 +814,6 @@ class ConnectionRequest : public StunRequest {
connection_(connection) {
}
virtual ~ConnectionRequest() {
}
void Prepare(StunMessage* request) override {
request->SetType(STUN_BINDING_REQUEST);
std::string username;
@ -1638,4 +1674,8 @@ int ProxyConnection::Send(const void* data, size_t size,
return sent;
}
int ProxyConnection::GetError() {
return error_;
}
} // namespace cricket

View File

@ -161,19 +161,19 @@ class Port : public PortInterface, public rtc::MessageHandler,
uint16_t max_port,
const std::string& username_fragment,
const std::string& password);
virtual ~Port();
~Port() override;
virtual const std::string& Type() const { return type_; }
virtual rtc::Network* Network() const { return network_; }
const std::string& Type() const override;
rtc::Network* Network() const override;
// Methods to set/get ICE role and tiebreaker values.
IceRole GetIceRole() const { return ice_role_; }
void SetIceRole(IceRole role) { ice_role_ = role; }
IceRole GetIceRole() const override;
void SetIceRole(IceRole role) override;
void SetIceTiebreaker(uint64_t tiebreaker) { tiebreaker_ = tiebreaker; }
uint64_t IceTiebreaker() const { return tiebreaker_; }
void SetIceTiebreaker(uint64_t tiebreaker) override;
uint64_t IceTiebreaker() const override;
virtual bool SharedSocket() const { return shared_socket_; }
bool SharedSocket() const override;
void ResetSharedSocket() { shared_socket_ = false; }
// Should not destroy the port even if no connection is using it. Called when
@ -226,9 +226,7 @@ class Port : public PortInterface, public rtc::MessageHandler,
sigslot::signal2<Port*, const Candidate&> SignalCandidateReady;
// Provides all of the above information in one handy object.
virtual const std::vector<Candidate>& Candidates() const {
return candidates_;
}
const std::vector<Candidate>& Candidates() const override;
// SignalPortComplete is sent when port completes the task of candidates
// allocation.
@ -246,8 +244,7 @@ class Port : public PortInterface, public rtc::MessageHandler,
const AddressMap& connections() { return connections_; }
// Returns the connection to the given address or NULL if none exists.
virtual Connection* GetConnection(
const rtc::SocketAddress& remote_addr);
Connection* GetConnection(const rtc::SocketAddress& remote_addr) override;
// Called each time a connection is created.
sigslot::signal2<Port*, Connection*> SignalConnectionCreated;
@ -256,22 +253,21 @@ class Port : public PortInterface, public rtc::MessageHandler,
// to accept the packet based on the |remote_addr|. Currently only UDP
// port implemented this method.
// TODO(mallinath) - Make it pure virtual.
virtual bool HandleIncomingPacket(
rtc::AsyncPacketSocket* socket, const char* data, size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time) {
RTC_NOTREACHED();
return false;
}
virtual bool HandleIncomingPacket(rtc::AsyncPacketSocket* socket,
const char* data,
size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time);
// Sends a response message (normal or error) to the given request. One of
// these methods should be called as a response to SignalUnknownAddress.
// NOTE: You MUST call CreateConnection BEFORE SendBindingResponse.
virtual void SendBindingResponse(StunMessage* request,
const rtc::SocketAddress& addr);
virtual void SendBindingErrorResponse(
StunMessage* request, const rtc::SocketAddress& addr,
int error_code, const std::string& reason);
void SendBindingResponse(StunMessage* request,
const rtc::SocketAddress& addr) override;
void SendBindingErrorResponse(StunMessage* request,
const rtc::SocketAddress& addr,
int error_code,
const std::string& reason) override;
void set_proxy(const std::string& user_agent,
const rtc::ProxyInfo& proxy) {
@ -281,15 +277,15 @@ class Port : public PortInterface, public rtc::MessageHandler,
const std::string& user_agent() { return user_agent_; }
const rtc::ProxyInfo& proxy() { return proxy_; }
virtual void EnablePortPackets();
void EnablePortPackets() override;
// Called if the port has no connections and is no longer useful.
void Destroy();
virtual void OnMessage(rtc::Message *pmsg);
void OnMessage(rtc::Message* pmsg) override;
// Debugging description of this port
virtual std::string ToString() const;
std::string ToString() const override;
uint16_t min_port() { return min_port_; }
uint16_t max_port() { return max_port_; }
@ -454,7 +450,7 @@ class Connection : public CandidatePairInterface,
uint32_t nomination;
};
virtual ~Connection();
~Connection() override;
// The local port where this connection sends and receives packets.
Port* port() { return port_; }
@ -462,9 +458,9 @@ class Connection : public CandidatePairInterface,
// Implementation of virtual methods in CandidatePairInterface.
// Returns the description of the local port
virtual const Candidate& local_candidate() const;
const Candidate& local_candidate() const override;
// Returns the description of the remote port to which we communicate.
virtual const Candidate& remote_candidate() const;
const Candidate& remote_candidate() const override;
// Returns the pair priority.
uint64_t priority() const;
@ -671,7 +667,7 @@ class Connection : public CandidatePairInterface,
uint32_t nomination() const { return nomination_; }
void OnMessage(rtc::Message *pmsg);
void OnMessage(rtc::Message* pmsg) override;
Port* port_;
size_t local_candidate_index_;
@ -746,7 +742,7 @@ class ProxyConnection : public Connection {
int Send(const void* data,
size_t size,
const rtc::PacketOptions& options) override;
int GetError() override { return error_; }
int GetError() override;
private:
int error_ = 0;

19
p2p/base/portinterface.cc Normal file
View File

@ -0,0 +1,19 @@
/*
* Copyright 2017 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "p2p/base/portinterface.h"
namespace cricket {
PortInterface::PortInterface() = default;
PortInterface::~PortInterface() = default;
} // namespace cricket

View File

@ -40,7 +40,7 @@ enum ProtocolType {
// the other client. Various types of ports will implement this interface.
class PortInterface {
public:
virtual ~PortInterface() {}
virtual ~PortInterface();
virtual const std::string& Type() const = 0;
virtual rtc::Network* Network() const = 0;
@ -124,7 +124,7 @@ class PortInterface {
virtual std::string ToString() const = 0;
protected:
PortInterface() {}
PortInterface();
};
} // namespace cricket

View File

@ -31,7 +31,7 @@ class RelayConnection : public sigslot::has_slots<> {
RelayConnection(const ProtocolAddress* protocol_address,
rtc::AsyncPacketSocket* socket,
rtc::Thread* thread);
~RelayConnection();
~RelayConnection() override;
rtc::AsyncPacketSocket* socket() const { return socket_; }
const ProtocolAddress* protocol_address() {
@ -78,7 +78,7 @@ class RelayEntry : public rtc::MessageHandler,
public sigslot::has_slots<> {
public:
RelayEntry(RelayPort* port, const rtc::SocketAddress& ext_addr);
~RelayEntry();
~RelayEntry() override;
RelayPort* port() { return port_; }
@ -125,7 +125,7 @@ class RelayEntry : public rtc::MessageHandler,
void HandleConnectFailure(rtc::AsyncPacketSocket* socket);
// Implementation of the MessageHandler Interface.
virtual void OnMessage(rtc::Message *pmsg);
void OnMessage(rtc::Message* pmsg) override;
private:
RelayPort* port_;
@ -162,7 +162,7 @@ class RelayEntry : public rtc::MessageHandler,
class AllocateRequest : public StunRequest {
public:
AllocateRequest(RelayEntry* entry, RelayConnection* connection);
virtual ~AllocateRequest() {}
~AllocateRequest() override = default;
void Prepare(StunMessage* request) override;
@ -387,6 +387,17 @@ int RelayPort::GetError() {
return error_;
}
bool RelayPort::SupportsProtocol(const std::string& protocol) const {
// Relay port may create both TCP and UDP connections.
return true;
}
ProtocolType RelayPort::GetProtocol() const {
// We shouldn't be using RelayPort, but we need to provide an implementation
// here.
return PROTO_UDP;
}
void RelayPort::OnReadPacket(
const char* data, size_t size,
const rtc::SocketAddress& remote_addr,

View File

@ -59,20 +59,12 @@ class RelayPort : public Port {
int SetOption(rtc::Socket::Option opt, int value) override;
int GetOption(rtc::Socket::Option opt, int* value) override;
int GetError() override;
bool SupportsProtocol(const std::string& protocol) const override {
// Relay port may create both TCP and UDP connections.
return true;
}
bool SupportsProtocol(const std::string& protocol) const override;
ProtocolType GetProtocol() const override;
const ProtocolAddress * ServerAddress(size_t index) const;
bool IsReady() { return ready_; }
ProtocolType GetProtocol() const override {
// We shouldn't be using RelayPort, but we need to provide an
// implementation here.
return PROTO_UDP;
}
// Used for testing.
sigslot::signal1<const ProtocolAddress*> SignalConnectFailure;
sigslot::signal1<const ProtocolAddress*> SignalSoftTimeout;

View File

@ -33,16 +33,13 @@ class StunBindingRequest : public StunRequest {
int64_t start_time)
: port_(port), server_addr_(addr), start_time_(start_time) {}
virtual ~StunBindingRequest() {
}
const rtc::SocketAddress& server_addr() const { return server_addr_; }
virtual void Prepare(StunMessage* request) override {
void Prepare(StunMessage* request) override {
request->SetType(STUN_BINDING_REQUEST);
}
virtual void OnResponse(StunMessage* response) override {
void OnResponse(StunMessage* response) override {
const StunAddressAttribute* addr_attr =
response->GetAddress(STUN_ATTR_MAPPED_ADDRESS);
if (!addr_attr) {
@ -63,7 +60,7 @@ class StunBindingRequest : public StunRequest {
}
}
virtual void OnErrorResponse(StunMessage* response) override {
void OnErrorResponse(StunMessage* response) override {
const StunErrorCodeAttribute* attr = response->GetErrorCode();
if (!attr) {
LOG(LS_ERROR) << "Missing binding response error code.";
@ -84,7 +81,7 @@ class StunBindingRequest : public StunRequest {
port_->stun_keepalive_delay());
}
}
virtual void OnTimeout() override {
void OnTimeout() override {
LOG(LS_ERROR) << "Binding request timed out from "
<< port_->GetLocalAddress().ToSensitiveString() << " ("
<< port_->Network()->name() << ")";
@ -299,6 +296,24 @@ int UDPPort::GetError() {
return error_;
}
bool UDPPort::HandleIncomingPacket(rtc::AsyncPacketSocket* socket,
const char* data,
size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time) {
// All packets given to UDP port will be consumed.
OnReadPacket(socket, data, size, remote_addr, packet_time);
return true;
}
bool UDPPort::SupportsProtocol(const std::string& protocol) const {
return protocol == UDP_PROTOCOL_NAME;
}
ProtocolType UDPPort::GetProtocol() const {
return PROTO_UDP;
}
void UDPPort::OnLocalAddressReady(rtc::AsyncPacketSocket* socket,
const rtc::SocketAddress& address) {
// When adapter enumeration is disabled and binding to the any address, the
@ -513,4 +528,49 @@ bool UDPPort::HasCandidateWithAddress(const rtc::SocketAddress& addr) const {
return false;
}
StunPort* StunPort::Create(rtc::Thread* thread,
rtc::PacketSocketFactory* factory,
rtc::Network* network,
uint16_t min_port,
uint16_t max_port,
const std::string& username,
const std::string& password,
const ServerAddresses& servers,
const std::string& origin) {
StunPort* port = new StunPort(thread, factory, network, min_port, max_port,
username, password, servers, origin);
if (!port->Init()) {
delete port;
port = NULL;
}
return port;
}
StunPort::StunPort(rtc::Thread* thread,
rtc::PacketSocketFactory* factory,
rtc::Network* network,
uint16_t min_port,
uint16_t max_port,
const std::string& username,
const std::string& password,
const ServerAddresses& servers,
const std::string& origin)
: UDPPort(thread,
factory,
network,
min_port,
max_port,
username,
password,
origin,
false) {
// UDPPort will set these to local udp, updating these to STUN.
set_type(STUN_PORT_TYPE);
set_server_addresses(servers);
}
void StunPort::PrepareAddress() {
SendStunBindingRequests();
}
} // namespace cricket

View File

@ -70,7 +70,7 @@ class UDPPort : public Port {
return port;
}
virtual ~UDPPort();
~UDPPort() override;
rtc::SocketAddress GetLocalAddress() const {
return socket_->GetLocalAddress();
@ -83,27 +83,22 @@ class UDPPort : public Port {
server_addresses_ = addresses;
}
virtual void PrepareAddress();
void PrepareAddress() override;
virtual Connection* CreateConnection(const Candidate& address,
CandidateOrigin origin);
virtual int SetOption(rtc::Socket::Option opt, int value);
virtual int GetOption(rtc::Socket::Option opt, int* value);
virtual int GetError();
Connection* CreateConnection(const Candidate& address,
CandidateOrigin origin) override;
int SetOption(rtc::Socket::Option opt, int value) override;
int GetOption(rtc::Socket::Option opt, int* value) override;
int GetError() override;
virtual bool HandleIncomingPacket(
rtc::AsyncPacketSocket* socket, const char* data, size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time) {
// All packets given to UDP port will be consumed.
OnReadPacket(socket, data, size, remote_addr, packet_time);
return true;
}
virtual bool SupportsProtocol(const std::string& protocol) const {
return protocol == UDP_PROTOCOL_NAME;
}
bool HandleIncomingPacket(rtc::AsyncPacketSocket* socket,
const char* data,
size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time) override;
virtual ProtocolType GetProtocol() const { return PROTO_UDP; }
bool SupportsProtocol(const std::string& protocol) const override;
ProtocolType GetProtocol() const override;
void set_stun_keepalive_delay(int delay) {
stun_keepalive_delay_ = delay;
@ -144,12 +139,13 @@ class UDPPort : public Port {
bool Init();
virtual int SendTo(const void* data, size_t size,
const rtc::SocketAddress& addr,
const rtc::PacketOptions& options,
bool payload);
int SendTo(const void* data,
size_t size,
const rtc::SocketAddress& addr,
const rtc::PacketOptions& options,
bool payload) override;
virtual void UpdateNetworkCost();
void UpdateNetworkCost() override;
void OnLocalAddressReady(rtc::AsyncPacketSocket* socket,
const rtc::SocketAddress& address);
@ -159,7 +155,7 @@ class UDPPort : public Port {
const rtc::PacketTime& packet_time);
void OnSentPacket(rtc::AsyncPacketSocket* socket,
const rtc::SentPacket& sent_packet);
const rtc::SentPacket& sent_packet) override;
void OnReadyToSend(rtc::AsyncPacketSocket* socket);
@ -181,7 +177,7 @@ class UDPPort : public Port {
class AddressResolver : public sigslot::has_slots<> {
public:
explicit AddressResolver(rtc::PacketSocketFactory* factory);
~AddressResolver();
~AddressResolver() override;
void Resolve(const rtc::SocketAddress& address);
bool GetResolvedAddress(const rtc::SocketAddress& input,
@ -262,21 +258,9 @@ class StunPort : public UDPPort {
const std::string& username,
const std::string& password,
const ServerAddresses& servers,
const std::string& origin) {
StunPort* port = new StunPort(thread, factory, network, min_port, max_port,
username, password, servers, origin);
if (!port->Init()) {
delete port;
port = NULL;
}
return port;
}
const std::string& origin);
virtual ~StunPort() {}
virtual void PrepareAddress() {
SendStunBindingRequests();
}
void PrepareAddress() override;
protected:
StunPort(rtc::Thread* thread,
@ -287,20 +271,7 @@ class StunPort : public UDPPort {
const std::string& username,
const std::string& password,
const ServerAddresses& servers,
const std::string& origin)
: UDPPort(thread,
factory,
network,
min_port,
max_port,
username,
password,
origin,
false) {
// UDPPort will set these to local udp, updating these to STUN.
set_type(STUN_PORT_TYPE);
set_server_addresses(servers);
}
const std::string& origin);
};
} // namespace cricket

View File

@ -246,6 +246,14 @@ int TCPPort::GetError() {
return error_;
}
bool TCPPort::SupportsProtocol(const std::string& protocol) const {
return protocol == TCP_PROTOCOL_NAME || protocol == SSLTCP_PROTOCOL_NAME;
}
ProtocolType TCPPort::GetProtocol() const {
return PROTO_TCP;
}
void TCPPort::OnNewConnection(rtc::AsyncPacketSocket* socket,
rtc::AsyncPacketSocket* new_socket) {
RTC_DCHECK(socket == socket_);

View File

@ -51,11 +51,8 @@ class TCPPort : public Port {
int GetOption(rtc::Socket::Option opt, int* value) override;
int SetOption(rtc::Socket::Option opt, int value) override;
int GetError() override;
bool SupportsProtocol(const std::string& protocol) const override {
return protocol == TCP_PROTOCOL_NAME || protocol == SSLTCP_PROTOCOL_NAME;
}
ProtocolType GetProtocol() const override { return PROTO_TCP; }
bool SupportsProtocol(const std::string& protocol) const override;
ProtocolType GetProtocol() const override;
protected:
TCPPort(rtc::Thread* thread,

View File

@ -284,6 +284,26 @@ rtc::SocketAddress TurnPort::GetLocalAddress() const {
return socket_ ? socket_->GetLocalAddress() : rtc::SocketAddress();
}
ProtocolType TurnPort::GetProtocol() const {
return server_address_.proto;
}
TlsCertPolicy TurnPort::GetTlsCertPolicy() const {
return tls_cert_policy_;
}
void TurnPort::SetTlsCertPolicy(TlsCertPolicy tls_cert_policy) {
tls_cert_policy_ = tls_cert_policy;
}
std::vector<std::string> TurnPort::GetTlsAlpnProtocols() const {
return tls_alpn_protocols_;
}
std::vector<std::string> TurnPort::GetTlsEllipticCurves() const {
return tls_elliptic_curves_;
}
void TurnPort::PrepareAddress() {
if (credentials_.username.empty() ||
credentials_.password.empty()) {
@ -660,6 +680,10 @@ void TurnPort::OnReadyToSend(rtc::AsyncPacketSocket* socket) {
}
}
bool TurnPort::SupportsProtocol(const std::string& protocol) const {
// Turn port only connects to UDP candidates.
return protocol == UDP_PROTOCOL_NAME;
}
// Update current server address port with the alternate server address port.
bool TurnPort::SetAlternateServer(const rtc::SocketAddress& address) {

View File

@ -85,7 +85,7 @@ class TurnPort : public Port {
customizer);
}
virtual ~TurnPort();
~TurnPort() override;
const ProtocolAddress& server_address() const { return server_address_; }
// Returns an empty address if the local address has not been assigned.
@ -97,49 +97,40 @@ class TurnPort : public Port {
}
const RelayCredentials& credentials() const { return credentials_; }
virtual ProtocolType GetProtocol() const { return server_address_.proto; }
ProtocolType GetProtocol() const override;
virtual TlsCertPolicy GetTlsCertPolicy() const { return tls_cert_policy_; }
virtual TlsCertPolicy GetTlsCertPolicy() const;
virtual void SetTlsCertPolicy(TlsCertPolicy tls_cert_policy);
virtual void SetTlsCertPolicy(TlsCertPolicy tls_cert_policy) {
tls_cert_policy_ = tls_cert_policy;
}
virtual std::vector<std::string> GetTlsAlpnProtocols() const;
virtual std::vector<std::string> GetTlsEllipticCurves() const;
virtual std::vector<std::string> GetTlsAlpnProtocols() const {
return tls_alpn_protocols_;
}
void PrepareAddress() override;
Connection* CreateConnection(const Candidate& c,
PortInterface::CandidateOrigin origin) override;
int SendTo(const void* data,
size_t size,
const rtc::SocketAddress& addr,
const rtc::PacketOptions& options,
bool payload) override;
int SetOption(rtc::Socket::Option opt, int value) override;
int GetOption(rtc::Socket::Option opt, int* value) override;
int GetError() override;
virtual std::vector<std::string> GetTlsEllipticCurves() const {
return tls_elliptic_curves_;
}
virtual void PrepareAddress();
virtual Connection* CreateConnection(
const Candidate& c, PortInterface::CandidateOrigin origin);
virtual int SendTo(const void* data, size_t size,
const rtc::SocketAddress& addr,
const rtc::PacketOptions& options,
bool payload);
virtual int SetOption(rtc::Socket::Option opt, int value);
virtual int GetOption(rtc::Socket::Option opt, int* value);
virtual int GetError();
virtual bool HandleIncomingPacket(rtc::AsyncPacketSocket* socket,
const char* data, size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time);
bool HandleIncomingPacket(rtc::AsyncPacketSocket* socket,
const char* data,
size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time) override;
virtual void OnReadPacket(rtc::AsyncPacketSocket* socket,
const char* data, size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time);
virtual void OnSentPacket(rtc::AsyncPacketSocket* socket,
const rtc::SentPacket& sent_packet);
void OnSentPacket(rtc::AsyncPacketSocket* socket,
const rtc::SentPacket& sent_packet) override;
virtual void OnReadyToSend(rtc::AsyncPacketSocket* socket);
virtual bool SupportsProtocol(const std::string& protocol) const {
// Turn port only connects to UDP candidates.
return protocol == UDP_PROTOCOL_NAME;
}
bool SupportsProtocol(const std::string& protocol) const override;
void OnSocketConnect(rtc::AsyncPacketSocket* socket);
void OnSocketClose(rtc::AsyncPacketSocket* socket, int error);
@ -222,8 +213,8 @@ class TurnPort : public Port {
typedef std::map<rtc::Socket::Option, int> SocketOptionsMap;
typedef std::set<rtc::SocketAddress> AttemptedServerSet;
virtual void OnMessage(rtc::Message* pmsg);
virtual void HandleConnectionDestroyed(Connection* conn);
void OnMessage(rtc::Message* pmsg) override;
void HandleConnectionDestroyed(Connection* conn) override;
bool CreateTurnClientSocket();