11-16-2017 06:53 AM
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
Solved! Go to Solution.
11-19-2017 03:12 PM
How about pinging the device?
11-20-2017 03:31 AM
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.
09-05-2019 09:13 AM
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.