chromium/third_party/webrtc/rtc_base/async_tcp_socket.cc

/*
 *  Copyright 2004 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 "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"  // for TimeMillis

#if defined(WEBRTC_POSIX)
#include <errno.h>
#endif  // WEBRTC_POSIX

namespace rtc {

static const size_t kMaxPacketSize =;

PacketLength;
static const size_t kPacketLenSize =;

static const size_t kBufSize =;

// The input buffer will be resized so that at least kMinimumRecvSize bytes can
// be received (but it will not grow above the maximum size passed to the
// constructor).
static const size_t kMinimumRecvSize =;

static const int kListenBacklog =;

// Binds and connects `socket`
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
// Binds and connects `socket` and creates AsyncTCPSocket for
// it. Takes ownership of `socket`. Returns null if bind() or
// connect() fail (`socket` is destroyed in that case).
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) {}

}  // namespace rtc