]> gitweb.factorcode.org Git - factor.git/commitdiff
io.sockets: Better docs for how to do a broadcast udp send.
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Jan 2021 00:35:42 +0000 (18:35 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Jan 2021 00:35:42 +0000 (18:35 -0600)
basis/io/sockets/sockets-docs.factor

index 2a4bb0fcbc59bbe531431f545ce99038d7877c17..0a1ff0bc966c3f71ddcd4cfce1eea10839b3aa11 100644 (file)
@@ -248,6 +248,16 @@ HELP: broadcast-once
         "B{ 1 2 3 } f 7777 <inet4> broadcast-once"
         ""
     }
+    "Send a datagram to the broadcast address, port 7777:"
+    { $example "USING: io.sockets prettyprint ;"
+        "B{ 1 2 3 } \"192.168.88.255\" 7777 <inet4> broadcast-once"
+        ""
+    }
+    "Receive a datagram on port 7777:"
+    { $example "USING: destructors kernel io.sockets ;"
+        "f 7777 <inet4> <datagram> [ receive ] [ dispose ] bi"
+        ""
+    }
 }
 { $description "Broadcasts a packet one time to the address and closes the sending broadcast port." } ;