Sure, just try to open a socket on a remote server. If socket does not open after some period of time then the ping failed, otherwise the ping was successful. http://spinneret.servebeer.com:5000/client/sget.htm
Tor how do you ping an IP address with the Spinneret?
I have no idea, I'm not familiar with the Spinneret. I was only pointing out that ping != socket connection, as the OP was asking about how to ping.. but I have to correct myself, there's a socket but it's not a TCP/IP connect involved. So if the API for the Spinneret doesn't support ICMP then the correct answer is that there's no way to actually ping an IP address from the Spinneret. If it can do ICMP then you can do ping. In C you would have done something like:
I would like to ping but testing socket connection I guess would work. all I'm trying to do is check if device is on or not essentially
For that Mike G's connect method will work fine. The only issue would be with timeouts. I'm looking at the code but after just a quick look I'm not certain if timeouts are a part of the socket layer level or not.. on ordinary desktop systems and servers there's a timeout buried down in the kernel and the timeout can vary between systems. On Linux the connect would hang for 3 seconds if the remote IP address was unavailable while on AIX it would hang for 75 seconds, just to pick two that I could test right now.
The Spinneret can respond to a ping. There is no mention of an out going ping in the W5100 datasheet or I do not see the feature listed.
The W5100 reports timeouts via socket registers and interrupts. I, as well as others, tend to poll the status register and use custom timers to determine a timeout.
Please see the W5100 datasheet and browse the existing code base, there's a lot of information. You might also take a peek at the link in post #2. Let me know if you have any questions.
thanks Mike I read over your post #2 and yes i may give this a try... Anyone have better suggestions on using the spinneret to check if a device is online or not? I was thinking of building a small windows service that would check in to the spinneret at periodic intervals but I'd like to be able to ping a list of ip addresses instead. Just want to see if this is the best approach, using a socket to check or trying to ping or some other way? Thanks
Comments
http://spinneret.servebeer.com:5000/client/sget.htm
-Tor
-Tor
-Tor
The W5100 reports timeouts via socket registers and interrupts. I, as well as others, tend to poll the status register and use custom timers to determine a timeout.
Please see the W5100 datasheet and browse the existing code base, there's a lot of information. You might also take a peek at the link in post #2. Let me know if you have any questions.