TCP Single client and Multiple servers

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

cross mob
Anonymous
Not applicable

Hi,

I am using wiced 4.1.0 version and RTOS is Threadx.Network is NetX_Duo.

I took tcp_client application which is present in snip as a reference.In that application 1 client can communicate with the one server.

I want to develop the existing application in which one client can communicate to multiple servers.

can anyone provide me some sample applications or else suggestions to proceed further.

One approach I am thinking is to create threads for each server.If that is the case then if suddenly one server no longer exists and memory will be wasted for that.How do client comes to know that the server is no longer present?

0 Likes
1 Solution
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

Please refer to https://community.cypress.com/thread/8636. You can check how wiced_tcp_register_callbacks() has been used to handle various TCP events in snip.tcp_server_async. If there is a TCP disconnection, the disconnect callback function will be executed and you can use wiced_tcp_delete_socket() to delete the TCP socket.

View solution in original post

1 Reply
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

Please refer to https://community.cypress.com/thread/8636. You can check how wiced_tcp_register_callbacks() has been used to handle various TCP events in snip.tcp_server_async. If there is a TCP disconnection, the disconnect callback function will be executed and you can use wiced_tcp_delete_socket() to delete the TCP socket.