Lines Matching defs:fds
77 static __maybe_unused void pair_udp_open(int fds[], uint16_t port)
81 fds[0] = socket(PF_INET, SOCK_DGRAM, 0);
82 fds[1] = socket(PF_INET, SOCK_DGRAM, 0);
83 if (fds[0] == -1 || fds[1] == -1) {
99 if (bind(fds[1], (void *) &daddr, sizeof(daddr))) {
103 if (bind(fds[0], (void *) &saddr, sizeof(saddr))) {
107 if (connect(fds[0], (void *) &daddr, sizeof(daddr))) {
113 static __maybe_unused void pair_udp_send_char(int fds[], int num, char payload)
120 if (write(fds[0], buf, sizeof(buf)) != sizeof(buf)) {
124 if (read(fds[1], rbuf, sizeof(rbuf)) != sizeof(rbuf)) {
135 static __maybe_unused void pair_udp_send(int fds[], int num)
137 return pair_udp_send_char(fds, num, DATA_CHAR);
140 static __maybe_unused void pair_udp_close(int fds[])
142 close(fds[0]);
143 close(fds[1]);