Lines Matching refs:fd
198 int fd = *(int *)dtls_get_app_data(ctx); in send_to_peer() local
199 return sendto(fd, data, len, MSG_DONTWAIT, in send_to_peer()
205 int fd; in dtls_handle_read() local
211 fd = *(int *)dtls_get_app_data(ctx); in dtls_handle_read()
213 if (!fd) in dtls_handle_read()
218 len = recvfrom(fd, buf, MAX_READ_BUF, 0, in dtls_handle_read()
347 int fd, result; local
431 fd = socket(dst.addr.sa.sa_family, SOCK_DGRAM, 0);
433 if (fd < 0) {
438 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on) ) < 0) {
442 flags = fcntl(fd, F_GETFL, 0);
443 if (flags < 0 || fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
450 if (setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on) ) < 0) {
452 if (setsockopt(fd, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on) ) < 0) {
462 dtls_context = dtls_new_context(&fd);
477 FD_SET(fd, &rfds);
483 result = select(fd+1, &rfds, &wfds, 0, &timeout);
490 if (FD_ISSET(fd, &wfds))
492 else if (FD_ISSET(fd, &rfds))