timeout for UDP recvfrom

This commit is contained in:
Raymond Knopp
2016-10-27 12:36:38 +02:00
parent af9c77d09f
commit e156079e33
3 changed files with 6 additions and 1 deletions
@@ -160,6 +160,7 @@ int trx_eth_read_udp_IF4p5(openair0_device *device, openair0_timestamp *timestam
if (bytes_received ==-1) {
eth->num_rx_errors++;
if (errno == EAGAIN) {
/*
again_cnt++;
usleep(10);
if (again_cnt == 1000) {
@@ -169,6 +170,9 @@ int trx_eth_read_udp_IF4p5(openair0_device *device, openair0_timestamp *timestam
printf("AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN \n");
goto again;
}
*/
printf("Lost IF4p5 connection with %s\n", inet_ntoa(eth->dest_addr.sin_addr));
exit(-1);
} else if (errno == EWOULDBLOCK) {
block_cnt++;
usleep(10);
@@ -96,6 +96,7 @@ int trx_eth_start(openair0_device *device) {
} else {
if(eth_get_dev_conf_udp(device)!=0) return -1;
}
if(ethernet_tune (device,RCV_TIMEOUT,999999)!=0) return -1;
} else if (eth->flags == ETH_RAW_IF5_MOBIPASS) {
printf("Setting ETHERNET to RAW_IF5_MODE\n");
if (eth_socket_init_raw(device)!=0) return -1;