| 111 | } |
| 112 | |
| 113 | static int configure_connect(int fd, struct sockaddr_in* addr) |
| 114 | { |
| 115 | int ret, val = 1; |
| 116 | |
| 117 | ret = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)); |
| 118 | if (ret == -1) { |
| 119 | perror("setsockopt()"); |
| 120 | return -1; |
| 121 | } |
| 122 | |
| 123 | ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); |
| 124 | if (ret == -1) { |
| 125 | perror("setsockopt()"); |
| 126 | return -1; |
| 127 | } |
| 128 | |
| 129 | memset(addr, 0, sizeof(*addr)); |
| 130 | addr->sin_family = AF_INET; |
| 131 | addr->sin_port = use_port; |
| 132 | ret = inet_aton("127.0.0.1", &addr->sin_addr); |
| 133 | return ret; |
| 134 | } |
| 135 | |
| 136 | static int connect_socket(struct io_uring *ring, int fd, int *code, int async) |
| 137 | { |
no outgoing calls