Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!ukma!widener!dsinc!unix.cis.pitt.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!ccncsu!purdue!news.cs.indiana.edu!news.nd.edu!spool.mu.edu!uwm.edu!ogicse!milton!biostr.washington.edu!kraig From: kraig@biostr.washington.edu (Kraig Eno) Newsgroups: comp.sys.mac.hypercard Subject: Re: Still looking for ping... Message-ID: <1991Apr11.145931.5148@biostr.washington.edu> Date: 11 Apr 91 22:00:34 GMT Sender: news@milton.u.washington.edu (News) Organization: Univ. of Washington Lines: 28 rainwatr@ucunix.san.uc.edu (Don Rainwater) writes: > >Well, I'm still looking for a way to 'ping' an internet node from > >within Hypercard. >[Looking at the MacTCP toolkit], nothing jumped out at me and said 'ping'. resnick@cogsci.uiuc.edu (Pete Resnick) responds: >> MacTCP does not currently allow you access to ICMP, which is the >> part of the TCP/IP protocol suite which 'ping' uses. MacTCP lets you send and receive TCP packets on any socket number. I don't know just how ping really works, but if you look at the man page, it says it sends a timestamp over the network which is then echoed by the remote host; when you receive the timestamp again, you can compute the round-trip travel time. Don, this would be trivially easy to do with the "TCP XCMD example" file that you get with the MacTCP toolkit. Simply open port #7 on a Unix box, which is the echo service, and use an idle handler to send it a stream of packets containing "the seconds". The unix host will bounce back whatever it receives. Whenever you get packets back, compute the time it took by comparing the time in the packet with the current time, to get elapsed time in seconds. For sub-second accuracy, you'd have to play a few more tricks, but this will get you started. Anyone with Unix source want to check and see if it uses port 7? Kraig Eno, kraig@biostr.washington.edu "Problems generate new knowledge" - M. Usui