#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <folly/io/async/AsyncServerSocket.h>
#include <sys/types.h>
#include <cerrno>
#include <cstring>
#include <folly/FileUtil.h>
#include <folly/GLog.h>
#include <folly/Portability.h>
#include <folly/SocketAddress.h>
#include <folly/String.h>
#include <folly/detail/SocketFastOpen.h>
#include <folly/io/async/EventBase.h>
#include <folly/io/async/NotificationQueue.h>
#include <folly/portability/Fcntl.h>
#include <folly/portability/Sockets.h>
#include <folly/portability/Unistd.h>
namespace folly {
#ifndef TCP_SAVE_SYN
#define TCP_SAVE_SYN …
#endif
#ifndef TCP_SAVED_SYN
#define TCP_SAVED_SYN …
#endif
static constexpr bool msgErrQueueSupported = …true;
#else
false;
#endif
AsyncServerSocket::AcceptCallback::~AcceptCallback() = default;
const uint32_t AsyncServerSocket::kDefaultMaxAcceptAtOnce;
const uint32_t AsyncServerSocket::kDefaultCallbackAcceptAtOnce;
const uint32_t AsyncServerSocket::kDefaultMaxMessagesInQueue;
void AsyncServerSocket::RemoteAcceptor::start(
EventBase* eventBase, uint32_t maxAtOnce) { … }
void AsyncServerSocket::RemoteAcceptor::stop(
EventBase* eventBase, AcceptCallback* callback) { … }
AtomicNotificationQueueTaskStatus AsyncServerSocket::NewConnMessage::operator()(
RemoteAcceptor& acceptor) noexcept { … }
AtomicNotificationQueueTaskStatus AsyncServerSocket::ErrorMessage::operator()(
RemoteAcceptor& acceptor) noexcept { … }
class AsyncServerSocket::BackoffTimeout : public AsyncTimeout { … };
AsyncServerSocket::AsyncServerSocket(EventBase* eventBase)
: … { … }
void AsyncServerSocket::setShutdownSocketSet(
const std::weak_ptr<ShutdownSocketSet>& wNewSS) { … }
AsyncServerSocket::~AsyncServerSocket() { … }
int AsyncServerSocket::stopAccepting(int shutdownFlags) { … }
void AsyncServerSocket::destroy() { … }
void AsyncServerSocket::attachEventBase(EventBase* eventBase) { … }
void AsyncServerSocket::detachEventBase() { … }
void AsyncServerSocket::useExistingSockets(
const std::vector<NetworkSocket>& fds) { … }
void AsyncServerSocket::useExistingSocket(NetworkSocket fd) { … }
void AsyncServerSocket::bindSocket(
NetworkSocket fd,
const SocketAddress& address,
bool isExistingSocket,
const std::string& ifName) { … }
bool AsyncServerSocket::setZeroCopy(bool enable) { … }
void AsyncServerSocket::bindInternal(
const SocketAddress& address, const std::string& ifName) { … }
void AsyncServerSocket::bind(const SocketAddress& address) { … }
void AsyncServerSocket::bind(
const SocketAddress& address, const std::string& ifName) { … }
void AsyncServerSocket::bind(
const std::vector<IPAddress>& ipAddresses, uint16_t port) { … }
void AsyncServerSocket::bind(
const std::vector<IPAddressIfNamePair>& addresses, uint16_t port) { … }
void AsyncServerSocket::bind(uint16_t port) { … }
void AsyncServerSocket::setEnableReuseAddr(bool enable) { … }
void AsyncServerSocket::listen(int backlog) { … }
void AsyncServerSocket::getAddress(SocketAddress* addressReturn) const { … }
std::vector<SocketAddress> AsyncServerSocket::getAddresses() const { … }
void AsyncServerSocket::addAcceptCallback(
AcceptCallback* callback, EventBase* eventBase, uint32_t maxAtOnce) { … }
void AsyncServerSocket::removeAcceptCallback(
AcceptCallback* callback, EventBase* eventBase) { … }
void AsyncServerSocket::startAccepting() { … }
void AsyncServerSocket::pauseAccepting() { … }
NetworkSocket AsyncServerSocket::createSocket(int family) { … }
void AsyncServerSocket::setTosReflect(bool enable) { … }
void AsyncServerSocket::setListenerTos(uint32_t tos) { … }
void AsyncServerSocket::setupSocket(NetworkSocket fd, int family) { … }
void AsyncServerSocket::handlerReady(
uint16_t ,
NetworkSocket fd,
sa_family_t addressFamily) noexcept { … }
void AsyncServerSocket::dispatchSocket(
NetworkSocket socket, SocketAddress&& address) { … }
void AsyncServerSocket::dispatchError(const char* msgstr, int errnoValue) { … }
void AsyncServerSocket::enterBackoff() { … }
void AsyncServerSocket::backoffTimeoutExpired() { … }
}