LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Connection lost detection with external TCPServer.

Solved!
Go to solution

Hello,

 

I am using external scanner with TCPServer. My question is how to detect lost connection with my scanner when e.g. battery drains out?

 

For connection I am using ConnectToTCPServer and TCPCallback function as callback.

 

I was thinking about some kind of polling e.g. ping to check if server is available.

 

How to do in proper way?

 

BR

M

 

 

 

 

 

 

0 Kudos
Message 1 of 4
(2,612 Views)
Solution
Accepted by topic author M.Ż.

How about pinging the device?

Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 2 of 4
(2,579 Views)

I have found function:

"int InetPing (const char *address, int *available, unsigned int timeout);".

 

I have already tested, it seems that it is what I was looking for.

 

 

Message 3 of 4
(2,562 Views)

Thanks for this topic -- I think it may be what I am looking for, as well. I am looking at some pre-existing code and it can hang if the remote connection is lost without sending a disconnect (power off, cable unplugged). This seems like a simple way to detect we are still talking.

0 Kudos
Message 4 of 4
(1,965 Views)