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

Function configure_connect

test/connect.c:113–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113static 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
136static int connect_socket(struct io_uring *ring, int fd, int *code, int async)
137{

Callers 2

connect_socketFunction · 0.85
test_connect_timeoutFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_connect_timeoutFunction · 0.68