Lines Matching refs:fds
75 static __maybe_unused void pair_udp_open(int fds[], uint16_t port) in pair_udp_open() argument
79 fds[0] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open()
80 fds[1] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open()
81 if (fds[0] == -1 || fds[1] == -1) { in pair_udp_open()
97 if (bind(fds[1], (void *) &daddr, sizeof(daddr))) { in pair_udp_open()
101 if (bind(fds[0], (void *) &saddr, sizeof(saddr))) { in pair_udp_open()
105 if (connect(fds[0], (void *) &daddr, sizeof(daddr))) { in pair_udp_open()
111 static __maybe_unused void pair_udp_send_char(int fds[], int num, char payload) in pair_udp_send_char() argument
118 if (write(fds[0], buf, sizeof(buf)) != sizeof(buf)) { in pair_udp_send_char()
122 if (read(fds[1], rbuf, sizeof(rbuf)) != sizeof(rbuf)) { in pair_udp_send_char()
133 static __maybe_unused void pair_udp_send(int fds[], int num) in pair_udp_send() argument
135 return pair_udp_send_char(fds, num, DATA_CHAR); in pair_udp_send()
138 static __maybe_unused void pair_udp_close(int fds[]) in pair_udp_close() argument
140 close(fds[0]); in pair_udp_close()
141 close(fds[1]); in pair_udp_close()