28 virtual std::shared_ptr<folly::AsyncSocketBase>
newSocket(
33 std::shared_ptr<folly::AsyncSocketBase> sock,
38 std::shared_ptr<folly::AsyncSocketBase> sock,
52 std::shared_ptr<folly::AsyncServerSocket>
socket(
55 socket->setMaxNumMessagesInQueue(
57 socket->setReusePortEnabled(reuse);
61 socket->bind(address);
64 socket->startAccepting();
73 socket->removeAcceptCallback(callback, base);
80 socket->addAcceptCallback(callback, base);
105 std::shared_ptr<folly::AsyncUDPServerSocket>
socket(
108 socket->setReusePort(reuse);
109 socket->bind(address);
124 socket->addListener(base, callback);
void addAcceptCB(std::shared_ptr< folly::AsyncSocketBase > s, Acceptor *callback, folly::EventBase *base) override
EventBase * getEventBase() const
std::shared_ptr< folly::AsyncSocketBase > newSocket(folly::SocketAddress address, int, bool reuse, const ServerSocketConfig &config) override
virtual void removeAcceptCB(std::shared_ptr< folly::AsyncSocketBase > sock, Acceptor *callback, folly::EventBase *base)=0
EventBase * getEventBase() const override
bool runImmediatelyOrRunInEventBaseThreadAndWait(void(*fn)(T *), T *arg)
void operator()(folly::AsyncServerSocket *socket) const
virtual void addAcceptCB(std::shared_ptr< folly::AsyncSocketBase > sock, Acceptor *callback, folly::EventBase *base)=0
static EventBaseManager * get()
void removeAcceptCB(std::shared_ptr< folly::AsyncSocketBase >, Acceptor *, folly::EventBase *) override
void addAcceptCB(std::shared_ptr< folly::AsyncSocketBase > s, Acceptor *callback, folly::EventBase *base) override
void operator()(folly::AsyncUDPServerSocket *socket) const
uint32_t fastOpenQueueSize
NetworkSocket socket(int af, int type, int protocol)
uint32_t maxNumPendingConnectionsPerWorker
std::shared_ptr< folly::AsyncSocketBase > newSocket(folly::SocketAddress address, int, bool reuse, const ServerSocketConfig &) override
EventBase * getEventBase() const override
void removeAcceptCB(std::shared_ptr< folly::AsyncSocketBase > s, Acceptor *callback, folly::EventBase *base) override
virtual ~ServerSocketFactory()=default
virtual std::shared_ptr< folly::AsyncSocketBase > newSocket(folly::SocketAddress address, int backlog, bool reuse, const ServerSocketConfig &config)=0