MCPcopy Create free account
hub / github.com/axboe/liburing / test_connect_with_no_peer

Function test_connect_with_no_peer

test/connect.c:182–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182static int test_connect_with_no_peer(struct io_uring *ring)
183{
184 int connect_fd;
185 int ret, code;
186
187 connect_fd = create_socket();
188 if (connect_fd == -1)
189 return -1;
190
191 ret = connect_socket(ring, connect_fd, &code, 0);
192 if (ret == -1)
193 goto err;
194
195 if (code != -ECONNREFUSED) {
196 if (code == -EINVAL || code == -EBADF || code == -EOPNOTSUPP) {
197 fprintf(stdout, "No connect support, skipping\n");
198 no_connect = 1;
199 goto out;
200 }
201 fprintf(stderr, "connect failed with %d\n", code);
202 goto err;
203 }
204
205out:
206 close(connect_fd);
207 return 0;
208
209err:
210 close(connect_fd);
211 return -1;
212}
213
214static int test_connect(struct io_uring *ring, int async)
215{

Callers 1

testFunction · 0.85

Calls 2

create_socketFunction · 0.85
connect_socketFunction · 0.85

Tested by

no test coverage detected