Advanced Network Programming with APII9/W for Dyalog APL --by Dr. Andrei K~ndrasA~ Chicago, Illinois 0 type - 8 15 16 code - 0 checksum sequence number optional data [ m identifier Figure I: ICMP echo request message In the simplest case, we need to send only 8 bytes to the IP level to generate an echo request message. Here is a simple program that does the job. Please refer to the previous article for definitions of SHARE, SAY, and END functions. q P/NG ADDR;S;A n PINGS AN INTERNES ADDRES FROM "ADDR" ~ RAW SOCKETS SUPPORt IS BEQUIRED! [3] SHARE [4] S~SAX 'SOCKET' 'RAW' 1 [5] SAY 'SENDT0' S 0 'N' 2 0 ADDB (8 0 247 255 0 0 0 0) [63 ~(I=SAY 'SELEC2' S '' " 30)/OK [7] ADDR,' is not responding.' o ~EX [8] OK:AsSAY 'RECVFROM' S 0 'N' [9] 'Beceived response from ',~3=2=A [10] EX:SAY 'CLOSE' S [11] END [1] [2] This article is a continuation of the paper published in the previous issue of APL Quote Quad, entitled "Introduction to Network Programming with APL." ICMP protocol: The PING program OST T C P / I P IMPLEMENTATIONSprovide a "ping" program as a diagnostic tool.
/lp/association-for-computing-machinery/advanced-network-programming-with-ap119-w-for-dyalog-apl-IA06UX20AY