Ping

BlitzMax Forums/BlitzMax Programming/Ping

xlsior(Posted 2007) [#1]
Does anyone have any pointers on how to send/receive a ping packet from within Blitzmax in windows?


FlameDuck(Posted 2007) [#2]
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.


xlsior(Posted 2007) [#3]
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?


GW(Posted 2007) [#4]
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.


Vertex(Posted 2007) [#5]
http://vertex.dreamfall.at/bnet/bnetex170beta2.zip
Checkout examples/ping.bmx


Blueapples(Posted 2007) [#6]
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).


Dreamora(Posted 2007) [#7]
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)


xlsior(Posted 2007) [#8]
Firewall won't be an issue here... Anyway, it looks lik Vertex' link will be the easiest to implement. Thanks a million!