TCP keepalive with NetX

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Problem: TCP keepalive support does not seem to be enabled in shipped NetX libraries

Description: I have tested this with multiple SDK versions, for example 6.1. On a HTTP long-poll connection, calling wiced_tcp_enable_keepalive() on the socket seems to have no effect, as verified by Wireshark capture. No keepalive packets are being sent with any combination of
- keepalive interval, tried 3, 10 , 30 and 60 seconds
- setting keepalive before connecting the socket, after connecting the socket.

- And of course, wiced_tcp_enable_keepalive itself returns WICED_TCPIP_UNSUPPORTED, even though it sets nx_tcp_socket_keepalive_timeout on the Netx socket.
- NetX User guide excplictly states that the library needs to be compiled with NX_ENABLE_TCP_KEEPALIVE, which defaults to off.

There are some very old threads on the forums where a custom built NetX library seem to have resolved the issue: How can I use(or change) the <TCP Keep Alive Option>?


Is it possible to provide keepalive-enabled versions of the libraries in SDKs ? Would need this for multiple versions of the SDK releases

1 Solution
AxLi_1746341
Level 7
Level 7
10 comments on KBA 5 comments on KBA First comment on KBA

KaidoKert wrote:

Problem: TCP keepalive support does not seem to be enabled in shipped NetX libraries

Description: I have tested this with multiple SDK versions, for example 6.1. On a HTTP long-poll connection, calling wiced_tcp_enable_keepalive() on the socket seems to have no effect, as verified by Wireshark capture. No keepalive packets are being sent with any combination of
- keepalive interval, tried 3, 10 , 30 and 60 seconds
- setting keepalive before connecting the socket, after connecting the socket.

- And of course, wiced_tcp_enable_keepalive itself returns WICED_TCPIP_UNSUPPORTED, even though it sets nx_tcp_socket_keepalive_timeout on the Netx socket.

FYI, In sdk-6.2.1, wiced_tcp_enable_keepalive() returns WICED_TCPIP_SUCCESS for NetX_Duo.

I don't know if it work or not, maybe you can check it.

View solution in original post

0 Likes
1 Reply
AxLi_1746341
Level 7
Level 7
10 comments on KBA 5 comments on KBA First comment on KBA

KaidoKert wrote:

Problem: TCP keepalive support does not seem to be enabled in shipped NetX libraries

Description: I have tested this with multiple SDK versions, for example 6.1. On a HTTP long-poll connection, calling wiced_tcp_enable_keepalive() on the socket seems to have no effect, as verified by Wireshark capture. No keepalive packets are being sent with any combination of
- keepalive interval, tried 3, 10 , 30 and 60 seconds
- setting keepalive before connecting the socket, after connecting the socket.

- And of course, wiced_tcp_enable_keepalive itself returns WICED_TCPIP_UNSUPPORTED, even though it sets nx_tcp_socket_keepalive_timeout on the Netx socket.

FYI, In sdk-6.2.1, wiced_tcp_enable_keepalive() returns WICED_TCPIP_SUCCESS for NetX_Duo.

I don't know if it work or not, maybe you can check it.

0 Likes