MCPcopy Create free account
hub / github.com/acl-dev/acl / udp_client_open

Function udp_client_open

lib_acl/samples/udp/udp.cpp:140–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140SOCK_UDP *udp_client_open(const char *local, const char *peer)
141{
142 struct addrinfo *peer_res0 = host_addrinfo(peer);
143 SOCK_UDP *sock;
144
145 if (peer_res0 == NULL)
146 return NULL;
147
148 sock = sock_open(local);
149 if (sock == NULL) {
150 freeaddrinfo(peer_res0);
151 return NULL;
152 }
153
154 memcpy(&sock->sa_peer, peer_res0->ai_addr, peer_res0->ai_addrlen);
155 sock->sa_peer_len = peer_res0->ai_addrlen;
156 freeaddrinfo(peer_res0);
157 return sock;
158}
159
160SOCK_UDP *udp_server_open(const char *local)
161{

Callers 1

runFunction · 0.85

Calls 4

sock_openFunction · 0.85
memcpyFunction · 0.85
host_addrinfoFunction · 0.70
freeaddrinfoFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…