#include "p2p/base/tcp_port.h"
#include <errno.h>
#include <utility>
#include <vector>
#include "absl/algorithm/container.h"
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "api/task_queue/pending_task_safety_flag.h"
#include "api/units/time_delta.h"
#include "p2p/base/p2p_constants.h"
#include "rtc_base/checks.h"
#include "rtc_base/ip_address.h"
#include "rtc_base/logging.h"
#include "rtc_base/net_helper.h"
#include "rtc_base/network/received_packet.h"
#include "rtc_base/rate_tracker.h"
#include "rtc_base/thread.h"
namespace cricket {
IceCandidateType;
SafeTask;
TimeDelta;
TCPPort::TCPPort(const PortParametersRef& args,
uint16_t min_port,
uint16_t max_port,
bool allow_listen)
: … { … }
TCPPort::~TCPPort() { … }
Connection* TCPPort::CreateConnection(const Candidate& address,
CandidateOrigin origin) { … }
void TCPPort::PrepareAddress() { … }
int TCPPort::SendTo(const void* data,
size_t size,
const rtc::SocketAddress& addr,
const rtc::PacketOptions& options,
bool payload) { … }
int TCPPort::GetOption(rtc::Socket::Option opt, int* value) { … }
int TCPPort::SetOption(rtc::Socket::Option opt, int value) { … }
int TCPPort::GetError() { … }
bool TCPPort::SupportsProtocol(absl::string_view protocol) const { … }
ProtocolType TCPPort::GetProtocol() const { … }
void TCPPort::OnNewConnection(rtc::AsyncListenSocket* socket,
rtc::AsyncPacketSocket* new_socket) { … }
void TCPPort::TryCreateServerSocket() { … }
rtc::AsyncPacketSocket* TCPPort::GetIncoming(const rtc::SocketAddress& addr,
bool remove) { … }
void TCPPort::OnReadPacket(rtc::AsyncPacketSocket* socket,
const rtc::ReceivedPacket& packet) { … }
void TCPPort::OnSentPacket(rtc::AsyncPacketSocket* socket,
const rtc::SentPacket& sent_packet) { … }
void TCPPort::OnReadyToSend(rtc::AsyncPacketSocket* socket) { … }
TCPConnection::TCPConnection(rtc::WeakPtr<Port> tcp_port,
const Candidate& candidate,
rtc::AsyncPacketSocket* socket)
: … { … }
TCPConnection::~TCPConnection() { … }
int TCPConnection::Send(const void* data,
size_t size,
const rtc::PacketOptions& options) { … }
int TCPConnection::GetError() { … }
void TCPConnection::OnSentPacket(rtc::AsyncPacketSocket* socket,
const rtc::SentPacket& sent_packet) { … }
void TCPConnection::OnConnectionRequestResponse(StunRequest* req,
StunMessage* response) { … }
void TCPConnection::OnConnect(rtc::AsyncPacketSocket* socket) { … }
void TCPConnection::OnClose(rtc::AsyncPacketSocket* socket, int error) { … }
void TCPConnection::MaybeReconnect() { … }
void TCPConnection::OnReadPacket(rtc::AsyncPacketSocket* socket,
const rtc::ReceivedPacket& packet) { … }
void TCPConnection::OnReadyToSend(rtc::AsyncPacketSocket* socket) { … }
void TCPConnection::OnDestroyed(Connection* c) { … }
void TCPConnection::CreateOutgoingTcpSocket() { … }
void TCPConnection::ConnectSocketSignals(rtc::AsyncPacketSocket* socket) { … }
void TCPConnection::DisconnectSocketSignals(rtc::AsyncPacketSocket* socket) { … }
}