return true;
}
-static int setup_tcp_listen_socket(meshlink_handle_t *mesh, const struct addrinfo *aip) {
+int setup_tcp_listen_socket(meshlink_handle_t *mesh, const struct addrinfo *aip) {
int nfd = socket(aip->ai_family, SOCK_STREAM, IPPROTO_TCP);
if(nfd == -1) {
return nfd;
}
-static int setup_udp_socket(meshlink_handle_t *mesh, const struct addrinfo *aip) {
+int setup_udp_listen_socket(meshlink_handle_t *mesh, const struct addrinfo *aip) {
int nfd = socket(aip->ai_family, SOCK_DGRAM, IPPROTO_UDP);
if(nfd == -1) {
/* If TCP worked, then we require that UDP works as well. */
- int udp_fd = setup_udp_socket(mesh, aip);
+ int udp_fd = setup_udp_listen_socket(mesh, aip);
if(udp_fd == -1) {
closesocket(tcp_fd);