Ping
BlitzMax Forums/BlitzMax Programming/Ping
| ||
Does anyone have any pointers on how to send/receive a ping packet from within Blitzmax in windows? |
| ||
Depends on wheter you want to use ICMP packets or not. I don't believe Blitz exposes raw (bsd) sockets, so I don't suppose those are possible. |
| ||
That's what I figured... I was hoping for plain ICMP pings, but didn't see a way to do those myself. Is there any standard windows API that allows you to deal with ICMP? |
| ||
I think its possible, I've done it in visualbasic using just win API functions long ago. I would look on the net for some example VB code to port. |
| ||
http://vertex.dreamfall.at/bnet/bnetex170beta2.zip Checkout examples/ping.bmx |
| ||
Note that we've run into issues with some user's firewalls blocking ICMP traffic for no apparent reason. Not sure what you want to use this for, but it's possible that might become an issue for you at some point. If you're just looking for an internet connection (as we are), I advice sending an HTTP request to a real resource and seeing if it times out. Pretty much the only way to be sure you're "online" (though of course the firewall can cause further problems). |
| ||
Any software firewall will block icmp traffic by default, at least any I head so far. (experience due to the fact that I connect my XBox 360 per wire through my notebook to the wlan) |
| ||
Firewall won't be an issue here... Anyway, it looks lik Vertex' link will be the easiest to implement. Thanks a million! |