------ art_20582_11825323.1140747343730 Content-Type: multipart/alternative; boundary --- art_20583_5306956.1140747343730" ------ art_20583_5306956.1140747343730 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ping.rb has bothered me for a while for two reasons. First, it really ought to be Net::Ping. Second, it ought to do more than just TCP pings. I've started to hack on a replacement. It currently does TCP and UDP pings (with service checking for TCP) but lacks good documentation, ICMP ping implementation, and unit tests. The first two are on my list to get done soon (I hope). The last one is a source of embarassment though. I don't see a good way to test it. Is there a testing guru willing to beat me about the head and shoulders with a clue stick? My implementation of Net::Ping is attached. Criticism is welcome. thanks, -pate ------ art_20583_5306956.1140747343730 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ping.rb has bothered me for a while for two reasons. First, it reallyught to be <br> Net::Ping. Second, it ought to do more than just TCP pings. I've started to hack<br> on a replacement. It currently does TCP and UDP pings (with service checking<br> for TCP) but lacks good documentation, ICMP ping implementation, and unit tests. <br> The first two are on my list to get done soon (I hope). The last one is a source <br> of embarassment though. I don't see a good way to test it. Is there a testing<br> guru willing to beat me about the head and shoulders with a clue stick?<br> <br> <br> My implementation of Net::Ping is attached. Criticism is welcome.<br> <br> thanks,<br> -pate<br> <br> <br> ------ art_20583_5306956.1140747343730-- ------ art_20582_11825323.1140747343730 Content-Type: text/x-ruby-script; name="ping.rb" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ping.rb" X-Attachment-Id: f_ek1vf9ib IyEvdXNyL2Jpbi9ydWJ5CiMKIyBwaW5nLnJiIC0tIGNoZWNrIGEgaG9zdCBmb3IgcmVhY2hhYmls aXR5CiMKIz0gU1lOT1BTSVMKIwojICAgcmVxdWlyZSAnbmV0L3BpbmcnCiMgICBwID0gTmV0OjpQ aW5nLm5ldygndGNwJykKIyAgIHAuc2VydmljZSA9ICdodHRwJwojICAgcC5zZXJ2aWNlX2NoZWNr ID0gdHJ1ZQojICAgaG9zdCA9ICd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Lm5ldyhob3N0LCBA cG9ydCkKICAgICAgICAgICAgcy5jbG9zZQogICAgICAgICAgZWxzaWYgQHByb3RvY29sID09ICd1 ZHAnCiAgICAgICAgICAgIHMgPSBVRFBTb2NrZXQubmV3CiAgICAgICAgICAgIHMuYmluZCggIiIs IDIzMDAwICkKICAgICAgICAgICAgcy5zZW5kKCAiSGVsbG9cbiIsIDAsIGhvc3QsIEBwb3J0ICkK ICAgICAgICAgICAgbXNnID0gcy5yZWN2ZnJvbSggMTAwLCAwICkKICAgICAgICAgICAgaWYgbXNn WzBdICE9ICJIZWxsb1xuIgogICAgICAgICAgICAgIHJldHVybiBmYWxzZQogICAgICAgICAgICBl bmQKICAgICAgICAgIGVuZAogICAgICAgIGVuZAogICAgICByZXNjdWUgRXJybm86OkVDT05OUkVG VVNFRAogICAgICAgIGlmIEBzZXJ2aWNlX2NoZWNrIHx8IEBwcm90b2NvbCAhPSAndGNwJwogICAg ICAgICAgcmV0dXJuIGZhbHNlCiAgICAgICAgZWxzZQogICAgICAgICAgcmV0dXJuIHRydWUKICAg ICAgICBlbmQKICAgICAgcmVzY3VlIFRpbWVvdXQ6OkVycm9yLCBTdGFuZGFyZEVycm9yCiAgICAg ICAgcmV0dXJuIGZhbHNlCiAgICAgIGVuZAogICAgICByZXR1cm4gdHJ1ZQogICAgZW5kCiAgZW5k CmVuZAoKaWYgJDAgPT0gX19GSUxFX18KICBob3N0ID0gQVJHVlswXQogIGhvc3QgfHw9ICJsb2Nh bGhvc3QiCgogIHAgPSBOZXQ6OlBpbmcubmV3CiAgaWYgIHAucGluZyhob3N0KQogICAgcHV0cyAi I3tob3N0fSBpcyBhbGl2ZSEiIAogIGVsc2UKICAgIHB1dHMgIiN7aG9zdH0gaXMgZGVhZCEiCiAg ZW5kCmVuZAo------ art_20582_11825323.1140747343730--