#include "quiche/quic/core/io/socket.h"
#include <cerrno>
#include <climits>
#include <cstddef>
#include "absl/container/flat_hash_set.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "quiche/quic/core/io/socket_internal.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/platform/api/quic_socket_address.h"
#include "quiche/common/platform/api/quiche_logging.h"
#if defined(_WIN32)
#include "quiche/quic/core/io/socket_win.inc"
#else
#include "quiche/quic/core/io/socket_posix.inc"
#endif
namespace quic::socket_api {
namespace {
absl::StatusOr<AcceptResult> AcceptInternal(SocketFd fd) { … }
absl::Status SetSockOptInt(SocketFd fd, int level, int option, int value) { … }
}
absl::Status SetReceiveBufferSize(SocketFd fd, QuicByteCount size) { … }
absl::Status SetSendBufferSize(SocketFd fd, QuicByteCount size) { … }
absl::Status Connect(SocketFd fd, const QuicSocketAddress& peer_address) { … }
absl::Status GetSocketError(SocketFd fd) { … }
absl::Status Bind(SocketFd fd, const QuicSocketAddress& address) { … }
absl::StatusOr<QuicSocketAddress> GetSocketAddress(SocketFd fd) { … }
absl::Status Listen(SocketFd fd, int backlog) { … }
absl::StatusOr<AcceptResult> Accept(SocketFd fd, bool blocking) { … }
absl::StatusOr<absl::Span<char>> Receive(SocketFd fd, absl::Span<char> buffer,
bool peek) { … }
absl::StatusOr<absl::string_view> Send(SocketFd fd, absl::string_view buffer) { … }
absl::StatusOr<absl::string_view> SendTo(SocketFd fd,
const QuicSocketAddress& peer_address,
absl::string_view buffer) { … }
}