MQX 4.1 SNTP_oneshot() Timeout

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX 4.1 SNTP_oneshot() Timeout

Jump to solution
706 Views
Mike_d
Contributor IV

The SNTP_oneshot() takes 3 minutes to timeout regardless of the parameter passed in. How do we fix this?

0 Kudos
1 Solution
432 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Michael:

It doesn't ignore timeout. If I SNTP_oneshot an IP that at different subnet and the gateway is reachable, I get correct 3 s timeout.

If I SNTP_oneshot AN IP at different subnet via unreachable gateway, I get 180s timeout. with RTCS_ARP_CANT_RESOLVE error code. There is a 3 minites timer in the RTCS  ARP implementation.

Regards

Daniel

View solution in original post

2 Replies
432 Views
Mike_d
Contributor IV

Will I break anything if I add the following before using the socket in SNTP_timed_send_recv()?

timeout = TRUE;

error_code = setsockopt(sock, SOL_UDP, OPT_SEND_NOWAIT, &timeout, sizeof(timeout));

0 Kudos
433 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Michael:

It doesn't ignore timeout. If I SNTP_oneshot an IP that at different subnet and the gateway is reachable, I get correct 3 s timeout.

If I SNTP_oneshot AN IP at different subnet via unreachable gateway, I get 180s timeout. with RTCS_ARP_CANT_RESOLVE error code. There is a 3 minites timer in the RTCS  ARP implementation.

Regards

Daniel