#include "rtc_base/async_tcp_socket.h"
#include <stdint.h>
#include <string.h>
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <memory>
#include "api/array_view.h"
#include "rtc_base/byte_order.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/network/sent_packet.h"
#include "rtc_base/time_utils.h"
#if defined(WEBRTC_POSIX)
#include <errno.h>
#endif
namespace rtc {
static const size_t kMaxPacketSize = …;
PacketLength;
static const size_t kPacketLenSize = …;
static const size_t kBufSize = …;
static const size_t kMinimumRecvSize = …;
static const int kListenBacklog = …;
Socket* AsyncTCPSocketBase::ConnectSocket(
rtc::Socket* socket,
const rtc::SocketAddress& bind_address,
const rtc::SocketAddress& remote_address) { … }
AsyncTCPSocketBase::AsyncTCPSocketBase(Socket* socket, size_t max_packet_size)
: … { … }
AsyncTCPSocketBase::~AsyncTCPSocketBase() { … }
SocketAddress AsyncTCPSocketBase::GetLocalAddress() const { … }
SocketAddress AsyncTCPSocketBase::GetRemoteAddress() const { … }
int AsyncTCPSocketBase::Close() { … }
AsyncTCPSocket::State AsyncTCPSocketBase::GetState() const { … }
int AsyncTCPSocketBase::GetOption(Socket::Option opt, int* value) { … }
int AsyncTCPSocketBase::SetOption(Socket::Option opt, int value) { … }
int AsyncTCPSocketBase::GetError() const { … }
void AsyncTCPSocketBase::SetError(int error) { … }
int AsyncTCPSocketBase::SendTo(const void* pv,
size_t cb,
const SocketAddress& addr,
const rtc::PacketOptions& options) { … }
int AsyncTCPSocketBase::FlushOutBuffer() { … }
void AsyncTCPSocketBase::AppendToOutBuffer(const void* pv, size_t cb) { … }
void AsyncTCPSocketBase::OnConnectEvent(Socket* socket) { … }
void AsyncTCPSocketBase::OnReadEvent(Socket* socket) { … }
void AsyncTCPSocketBase::OnWriteEvent(Socket* socket) { … }
void AsyncTCPSocketBase::OnCloseEvent(Socket* socket, int error) { … }
AsyncTCPSocket* AsyncTCPSocket::Create(Socket* socket,
const SocketAddress& bind_address,
const SocketAddress& remote_address) { … }
AsyncTCPSocket::AsyncTCPSocket(Socket* socket)
: … { … }
int AsyncTCPSocket::Send(const void* pv,
size_t cb,
const rtc::PacketOptions& options) { … }
size_t AsyncTCPSocket::ProcessInput(rtc::ArrayView<const uint8_t> data) { … }
AsyncTcpListenSocket::AsyncTcpListenSocket(std::unique_ptr<Socket> socket)
: … { … }
AsyncTcpListenSocket::State AsyncTcpListenSocket::GetState() const { … }
SocketAddress AsyncTcpListenSocket::GetLocalAddress() const { … }
void AsyncTcpListenSocket::OnReadEvent(Socket* socket) { … }
void AsyncTcpListenSocket::HandleIncomingConnection(Socket* socket) { … }
}