Lines Matching refs:udp_fd
85 int udp_fd; member
338 int udp_fd = -1; in udp_socket_create() local
351 udp_fd = ff_socket(res->ai_family, SOCK_DGRAM, IPPROTO_UDPLITE); in udp_socket_create()
353 udp_fd = ff_socket(res->ai_family, SOCK_DGRAM, 0); in udp_socket_create()
354 if (udp_fd != -1) break; in udp_socket_create()
358 if (udp_fd < 0) in udp_socket_create()
366 return udp_fd; in udp_socket_create()
369 if (udp_fd >= 0) in udp_socket_create()
370 closesocket(udp_fd); in udp_socket_create()
427 if (connect(s->udp_fd, (struct sockaddr *) &s->dest_addr, in ff_udp_set_remote_url()
459 return s->udp_fd; in udp_get_file_handle()
471 if (ff_socket_nonblock(s->udp_fd, 0) < 0) { in circular_buffer_task_rx()
486 … len = recvfrom(s->udp_fd, s->tmp+4, sizeof(s->tmp)-4, 0, (struct sockaddr *)&addr, &addr_len); in circular_buffer_task_rx()
536 if (ff_socket_nonblock(s->udp_fd, 0) < 0) { in circular_buffer_task_tx()
594 ret = sendto (s->udp_fd, p, len, 0, in circular_buffer_task_tx()
598 ret = send(s->udp_fd, p, len, 0); in circular_buffer_task_tx()
629 int port, udp_fd = -1, tmp, bind_ret = -1, dscp = -1; in udp_open() local
754 udp_fd = udp_socket_create(h, &my_addr, &len, localaddr); in udp_open()
756 udp_fd = udp_socket_create(h, &my_addr, &len, s->localaddr); in udp_open()
757 if (udp_fd < 0) in udp_open()
767 …if (setsockopt (udp_fd, SOL_SOCKET, SO_REUSEADDR, &(s->reuse_socket), sizeof(s->reuse_socket)) != … in udp_open()
775 …if (setsockopt (udp_fd, SOL_SOCKET, SO_BROADCAST, &(s->is_broadcast), sizeof(s->is_broadcast)) != … in udp_open()
790 …if (setsockopt (udp_fd, IPPROTO_UDPLITE, UDPLITE_SEND_CSCOV, &(s->udplite_coverage), sizeof(s->udp… in udp_open()
793 …if (setsockopt (udp_fd, IPPROTO_UDPLITE, UDPLITE_RECV_CSCOV, &(s->udplite_coverage), sizeof(s->udp… in udp_open()
799 if (setsockopt (udp_fd, IPPROTO_IP, IP_TOS, &dscp, sizeof(dscp)) != 0) { in udp_open()
810 bind_ret = bind(udp_fd,(struct sockaddr *)&s->dest_addr, len); in udp_open()
815 if (bind_ret < 0 && bind(udp_fd,(struct sockaddr *)&my_addr, len) < 0) { in udp_open()
822 getsockname(udp_fd, (struct sockaddr *)&my_addr, &len); in udp_open()
828 if ((ret = udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr)) < 0) in udp_open()
834 if ((ret = udp_set_multicast_sources(h, udp_fd, in udp_open()
841 …if ((ret = udp_join_multicast_group(udp_fd, (struct sockaddr *)&s->dest_addr,(struct sockaddr *)&s… in udp_open()
845 if ((ret = udp_set_multicast_sources(h, udp_fd, in udp_open()
858 if (setsockopt(udp_fd, SOL_SOCKET, SO_SNDBUF, &tmp, sizeof(tmp)) < 0) { in udp_open()
866 if (setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)) < 0) { in udp_open()
870 if (getsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, &len) < 0) { in udp_open()
879 ff_socket_nonblock(udp_fd, 1); in udp_open()
882 if (connect(udp_fd, (struct sockaddr *) &s->dest_addr, s->dest_addr_len)) { in udp_open()
889 s->udp_fd = udp_fd; in udp_open()
940 if (udp_fd >= 0) in udp_open()
941 closesocket(udp_fd); in udp_open()
1009 ret = ff_network_wait_fd(s->udp_fd, 0); in udp_read()
1013 ret = recvfrom(s->udp_fd, buf, size, 0, (struct sockaddr *)&addr, &addr_len); in udp_read()
1056 ret = ff_network_wait_fd(s->udp_fd, 1); in udp_write()
1062 ret = sendto (s->udp_fd, buf, size, 0, in udp_write()
1066 ret = send(s->udp_fd, buf, size, 0); in udp_write()
1086 …udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr,(struct sockaddr *)&s->local… in udp_close()
1096 shutdown(s->udp_fd, SD_RECEIVE); in udp_close()
1097 CancelIoEx((HANDLE)(SOCKET)s->udp_fd, NULL); in udp_close()
1109 closesocket(s->udp_fd); in udp_close()