From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Check if TCP client connection failed

I am using tcp/ip server client protocol using in my project...and its working fine,but some time my client will hang how to detect  error in Server.

 

 

Thank you in Advance

0 Kudos
Message 1 of 2
(3,642 Views)

On one side you can ping the server IP to detect wether it is responsive. You can set a short timeout for InetPing so that your app is not handicapped.

On the other hand, you must manage TCP_DISCONNECT event in the client callback and take the appropriate countermeasures if it fires.

Once made this, the server usually have no other troubles, but  I suggest you to record all abnormal event you get together with any detail available, including runtime errors and function on error.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,636 Views)