MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / bind_socket

Function bind_socket

src/commons/support/events.cpp:177–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177static evutil_socket_t bind_socket(const char* address, ev_uint16_t port, int reuse) {
178 evutil_socket_t fd;
179 struct evutil_addrinfo* aitop = NULL;
180
181 /* just create an unbound socket */
182 if (address == NULL && port == 0) return bind_socket_ai(NULL, 0);
183
184 aitop = make_addrinfo(address, port);
185
186 if (aitop == NULL) return (-1);
187
188 fd = bind_socket_ai(aitop, reuse);
189
190 evutil_freeaddrinfo(aitop);
191
192 return (fd);
193}
194
195struct evhttp_bound_socket* evhttp_bind_accept_socket(struct evhttp* http, const char* address,
196 ev_uint16_t port) {

Callers 1

Calls 2

bind_socket_aiFunction · 0.85
make_addrinfoFunction · 0.85

Tested by

no test coverage detected