26 #define TCP_SAVE_SYN 27 29 TEST(AsyncSocketTest, getSockOpt) {
37 getsockopt(socket->getFd(), SOL_SOCKET, SO_REUSEADDR, &
val, &len);
38 int actualRc = socket->getSockOpt(SOL_SOCKET, SO_REUSEADDR, &val, &len);
43 TEST(AsyncSocketTest, REUSEPORT) {
46 serverSocket->bind(0);
47 serverSocket->listen(0);
48 serverSocket->startAccepting();
51 serverSocket->setReusePortEnabled(
true);
53 LOG(
INFO) <<
"Reuse port probably not supported";
62 serverSocket2->setReusePortEnabled(
true);
63 serverSocket2->bind(port);
64 serverSocket2->listen(0);
65 serverSocket2->startAccepting();
68 TEST(AsyncSocketTest, v4v6samePort) {
71 serverSocket->bind(0);
72 auto addrs = serverSocket->getAddresses();
75 for (
const auto&
addr : addrs) {
80 TEST(AsyncSocketTest, duplicateBind) {
93 TEST(AsyncSocketTest, tosReflect) {
98 int fd = server1->getSocket();
104 socklen_t valueLength =
sizeof(
value);
110 server1->setTosReflect(
true);
#define ASSERT_GT(val1, val2)
#define EXPECT_THROW(statement, expected_exception)
#define ASSERT_EQ(val1, val2)
#define EXPECT_EQ(val1, val2)
—— Concurrent Priority Queue Implementation ——
int getsockopt(NetworkSocket s, int level, int optname, void *optval, socklen_t *optlen)
static std::shared_ptr< AsyncServerSocket > newSocket(EventBase *evb=nullptr)
NetworkSocket socket(int af, int type, int protocol)
socklen_t getAddress(sockaddr_storage *addr) const
#define EXPECT_TRUE(condition)
static std::shared_ptr< AsyncSocket > newSocket(EventBase *evb)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
#define EXPECT_FALSE(condition)
ThreadPoolListHook * addr
TEST(SequencedExecutor, CPUThreadPoolExecutor)