| 208 | } |
| 209 | |
| 210 | static int set_client_fd(struct sockaddr_in *addr) |
| 211 | { |
| 212 | int32_t val; |
| 213 | int fd, ret; |
| 214 | |
| 215 | fd = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP); |
| 216 | |
| 217 | val = 1; |
| 218 | ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val)); |
| 219 | assert(ret != -1); |
| 220 | |
| 221 | t_set_nonblock(fd); |
| 222 | |
| 223 | ret = connect(fd, (struct sockaddr *)addr, sizeof(*addr)); |
| 224 | assert(ret == -1); |
| 225 | |
| 226 | t_clear_nonblock(fd); |
| 227 | return fd; |
| 228 | } |
| 229 | |
| 230 | static void cause_overflow(struct io_uring *ring) |
| 231 | { |