277 "failed to create test server socket",
280 if (fcntl(
fd_, F_SETFL, O_NONBLOCK) != 0) {
283 "failed to put test server socket in " 293 struct addrinfo hints, *res;
294 memset(&hints, 0,
sizeof(hints));
295 hints.ai_family = AF_INET;
296 hints.ai_socktype = SOCK_STREAM;
297 hints.ai_flags = AI_PASSIVE;
299 if (getaddrinfo(
nullptr,
"0", &hints, &res)) {
302 "Attempted to bind address to socket with " 312 setsockopt(
fd_, SOL_SOCKET, SO_SNDBUF, &bufSize,
sizeof(bufSize));
313 setsockopt(
fd_, SOL_SOCKET, SO_RCVBUF, &bufSize,
sizeof(bufSize));
316 if (
bind(
fd_, res->ai_addr, res->ai_addrlen)) {
319 "failed to bind to async server socket for port 10",
326 "failed to listen on test server socket",
int setsockopt(NetworkSocket s, int level, int optname, const void *optval, socklen_t optlen)
folly::SocketAddress address_
NetworkSocket socket(int af, int type, int protocol)
int listen(NetworkSocket s, int backlog)
int tfo_enable(int, size_t)
void setFromIpPort(const char *ip, uint16_t port)
void setFromLocalAddress(int socket)
int bind(NetworkSocket s, const sockaddr *name, socklen_t namelen)